gnu/72200: bzXgrep fails to detect that its matcher is Xgrep

J.R. Oldroyd fbsd at opal.com
Thu Sep 30 07:50:25 PDT 2004


>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 at 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:


More information about the freebsd-bugs mailing list