bsdgrep --null has no effect
Jan Beich
jbeich at tormail.net
Sun Nov 27 12:43:37 UTC 2011
Jan Beich <jbeich at tormail.net> writes:
> "O. Hartmann" <ohartman at 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);
More information about the freebsd-current
mailing list