bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The bug in the Grep Command


From: Eric Blake
Subject: Re: The bug in the Grep Command
Date: Mon, 06 Aug 2012 07:39:27 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0

On 08/06/2012 05:34 AM, Jim Meyering wrote:
> address@hidden 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   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]