Date: Thu, 30 Sep 2004 10:40:40 -0400 (EDT) From: "J.R. Oldroyd" <fbsd@opal.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: gnu/72200: bzXgrep fails to detect that its matcher is Xgrep Message-ID: <200409301440.i8UEee0Z027934@linwhf.opal.com> Resent-Message-ID: <200409301450.i8UEoP6J070358@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 72200
>Category: gnu
>Synopsis: bzXgrep fails to detect that its matcher is Xgrep
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Sep 30 14:50:25 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator: J.R. Oldroyd
>Release: FreeBSD 6.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD linwhf.opal.com 6.0-CURRENT FreeBSD 6.0-CURRENT #62: Tue Sep 28 15:27:07 EDT 2004 jr@linwhf.opal.com:/usr/src-current/sys/i386/compile/LINWHF i386
>Description:
When grep(1) is invoked as bzegrep or bzfgrep, it fails to
detect that it should use the egrep or fgrep matcher and behaves
as grep. Use of the -E or -F flags works, i.e., it is the
parsing of argv[0] that's broke.
>How-To-Repeat:
$ bzegrep '^(root|toor):' /etc/passwd
$
compare with:
$ bzegrep -E '^(root|toor):' /etc/passwd
root:*:0:0:Charlie &:/root:/bin/csh
toor:*:0:0:Bourne-again Superuser:/root:
$
>Fix:
--- grep.origc Sun Jul 4 12:16:59 2004
+++ grep.c Thu Sep 30 10:38:16 2004
@@ -1413,6 +1413,9 @@
if (program_name[0] == 'b') {
BZflag = 1;
++program_name;
+ if (program_name[0] == 'z') {
+ ++program_name;
+ }
}
#if defined(__MSDOS__) || defined(_WIN32)
>Release-Note:
>Audit-Trail:
>Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200409301440.i8UEee0Z027934>
