Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Nov 2011 19:07:30 +0800
From:      Jan Beich <jbeich@tormail.net>
To:        "O. Hartmann" <ohartman@zedat.fu-berlin.de>
Cc:        FreeBSD <freebsd-current@freebsd.org>, Current@FreeBSD.ORG, =?utf-8?B?R8OhYm9yIEvDtnZlc2TDoW4=?= <gabor@freebsd.org>
Subject:   Re: bsdgrep --null has no effect
Message-ID:  <1RUcaG-000Pux-OQ@internal.tormail.net>
In-Reply-To: <1RUbug-000P7m-2d@internal.tormail.net> (Jan Beich's message of "Sun, 27 Nov 2011 09:24:15 -0100")
References:  <4ED20A68.90102@zedat.fu-berlin.de> <1RUbug-000P7m-2d@internal.tormail.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Jan Beich <jbeich@tormail.net> writes:

> "O. Hartmann" <ohartman@zedat.fu-berlin.de> writes:
>
>> ===>  Patching for stellarium-0.11.1
>> sed:
>> /usr/ports/astro/stellarium/work/stellarium-0.11.1/src/core/external/fixx11h.h
>> /usr/ports/astro/stellarium/work/stellarium-0.11.1/src/CMakeLists.txt
>> /usr/ports/astro/stellarium/work/stellarium-0.11.1/plugins/TelescopeControl/src/TelescopeControl.hpp
>> /usr/ports/astro/stellarium/work/stellarium-0.11.1/plugins/Oculars/src/Oculars.hpp
>> /usr/ports/astro/stellarium/work/stellarium-0.11.1/plugins/CompassMarks/src/CompassMarks.hpp
>> /usr/ports/astro/stellarium/work/stellarium-0.11.1/plugins/TextUserInterface/src/TextUserInterface.hpp
>> /usr/ports/astro/stellarium/work/stellarium-0.11.1/plugins/Supernovae/src/Supernovae.hpp
>> /usr/ports/astro/stellarium/work/stellarium-0.11.1/plugins/SolarSystemEditor/src/SolarSystemEditor.hpp
>> /usr/ports/astro/stellarium/work/stellarium-0.11.1/plugins/Satellites/src/Satellites.hpp
>> /usr/ports/astro/stellarium/work/stellarium-0.11.1/plugins/HelloStelModule/src/HelloStelModule.hpp
>> /usr/ports/astro/stellarium/work/stellarium-0.11.1/plugins/TimeZoneConfiguration/src/TimeZoneConfiguration.hpp
>> /usr/ports/astro/stellarium/work/stellarium-0.11.1/plugins/AngleMeasure/src/AngleMeasure.hpp
>> : File name too long
>> *** Error code 1
>
> Do you use bsdgrep? ${GREP} -Rl --null ... | ${XARGS} -0 ... won't work.
>
>   $ gnugrep -l --null . /usr/include/md*.h | vis
>   /usr/include/md2.h\^@/usr/include/md4.h\^@/usr/include/md5.h\^@
>
>   $ bsdgrep -l --null . /usr/include/md*.h | vis
>   /usr/include/md2.h
>   /usr/include/md4.h
>   /usr/include/md5.h

Oops, here is a diff. Non -l/-L case still seems to be broken.

  $ echo t >a; echo t >b; echo t >c
  $ gnugrep --null . ? | vis
  a\^@t
  b\^@t
  c\^@t

  $ bsdgrep --null . ? | vis
  a\^@:t
  b\^@:t
  c\^@:t

Index: usr.bin/grep/util.c
===================================================================
--- usr.bin/grep/util.c	(revision 228003)
+++ usr.bin/grep/util.c	(working copy)
@@ -246,9 +246,9 @@ procfile(const char *fn)
 		printf("%u\n", c);
 	}
 	if (lflag && !qflag && c != 0)
-		printf("%s\n", fn);
+		printf("%s%c", fn, nullflag ? 0 : '\n');
 	if (Lflag && !qflag && c == 0)
-		printf("%s\n", fn);
+		printf("%s%c", fn, nullflag ? 0 : '\n');
 	if (c && !cflag && !lflag && !Lflag &&
 	    binbehave == BINFILE_BIN && f->binary && !qflag)
 		printf(getstr(8), fn);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1RUcaG-000Pux-OQ>