On 08/06/2012 05:34 AM, Jim Meyering wrote: > [email protected] wrote: >> The grep command in the current version of Debian, the 6th, with two >> options -i and -n the same will not work well when applied to an empty >> line there. >> >> For example: >> >> grep -in "^$" < /etc/inittab >> >> or >> grep -in "^$" < /etc/X11/xorg.conf > > Wow! Thank you for the report. >
> +++ b/NEWS > @@ -4,6 +4,13 @@ GNU grep NEWS -*- outline > -*- > > ** Bug fixes > > + grep -i '^$' could exit 0 (i.e., report a match) in a multi-byte locale, > + even though there was no match, and the command generated not output. s/not/no/ > +++ b/src/dfasearch.c > @@ -277,7 +277,9 @@ EGexecute (char const *buf, size_t size, size_t > *match_size, > /* No good fixed strings; start with DFA. */ > char const *next_beg = dfaexec (dfa, beg, (char *) buflim, > 0, NULL, &backref); > - if (next_beg == NULL) > + /* If there's no match, of if we've matched the sentinel, s/of/or/ -- Eric Blake [email protected] +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
