From owner-p4-projects@FreeBSD.ORG Fri Jun 20 19:12:16 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D03871065676; Fri, 20 Jun 2008 19:12:16 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 921CE1065671 for ; Fri, 20 Jun 2008 19:12:16 +0000 (UTC) (envelope-from gabor@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 7E6A58FC25 for ; Fri, 20 Jun 2008 19:12:16 +0000 (UTC) (envelope-from gabor@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m5KJCGnM066970 for ; Fri, 20 Jun 2008 19:12:16 GMT (envelope-from gabor@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m5KJCGff066968 for perforce@freebsd.org; Fri, 20 Jun 2008 19:12:16 GMT (envelope-from gabor@freebsd.org) Date: Fri, 20 Jun 2008 19:12:16 GMT Message-Id: <200806201912.m5KJCGff066968@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gabor@freebsd.org using -f From: Gabor Kovesdan To: Perforce Change Reviews Cc: Subject: PERFORCE change 143833 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jun 2008 19:12:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=143833 Change 143833 by gabor@gabor_server on 2008/06/20 19:11:20 - GNU compatibility: better --color codes Affected files ... .. //depot/projects/soc2008/gabor_textproc/grep/util.c#30 edit Differences ... ==== //depot/projects/soc2008/gabor_textproc/grep/util.c#30 (text+ko) ==== @@ -244,13 +244,13 @@ strlcpy(matched, &(l->dat[pmatch.rm_so]), pmatch.rm_eo - pmatch.rm_so + 1); strlcpy(end, &(l->dat[pmatch.rm_eo]), strlen(l->dat) - pmatch.rm_eo + 1); - asprintf(&tmp, "%s\33[%sm\33[K%s\33[00m\33[K%s", begin, color, matched, end); + asprintf(&tmp, "%s\33[%sm\33[K%s\33[m\33[K%s", begin, color, matched, end); free(begin); free(matched); free(end); - l->len += strlen(color) + 14; + l->len += strlen(color) + 12; l->dat = tmp; } if (r == 0 && oflag && !nottext) { @@ -261,7 +261,7 @@ strlcpy(matched, &(l->dat[pmatch.rm_so]), pmatch.rm_eo - pmatch.rm_so + 1); if (color != NULL) - asprintf(&tmp, "\33[%sm%s\33[00m", color, matched); + asprintf(&tmp, "\33[%sm%s\33[m", color, matched); else tmp = matched;