bug-grep
[Top][All Lists]
Advanced

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

Re: Bug#575300: fgrep -i does not always match what grep matches (due to


From: Aníbal Monsalve Salazar
Subject: Re: Bug#575300: fgrep -i does not always match what grep matches (due to locales)
Date: Thu, 25 Mar 2010 18:37:03 +1100
User-agent: Mutt/1.5.20 (2009-06-14)

On Wed, Mar 24, 2010 at 09:04:19PM +0100, David Madore wrote:
>Package: grep
>Version: 2.5.4-4
>
>Whether this is a bug is perhaps debatable (because of the vagueness
>of specifications in the matter), and maybe needs to be discussed
>upstream, but the following behavior is extremely confusing at the
>very least:
>
>vega david ~ $ locale
>LANG=
>LC_CTYPE=en_US.UTF-8
>LC_NUMERIC="POSIX"
>LC_TIME="POSIX"
>LC_COLLATE="POSIX"
>LC_MONETARY="POSIX"
>LC_MESSAGES="POSIX"
>LC_PAPER="POSIX"
>LC_NAME="POSIX"
>LC_ADDRESS="POSIX"
>LC_TELEPHONE="POSIX"
>LC_MEASUREMENT="POSIX"
>LC_IDENTIFICATION="POSIX"
>LC_ALL=
>vega david ~ $ printf 'foobar\251\n' > /tmp/test
>vega david ~ $ fgrep -q foobar /tmp/test
>vega david ~ $ echo $?
>0
>vega david ~ $ fgrep -q -i foobar /tmp/test
>vega david ~ $ echo $?
>1
>vega david ~ $ LC_CTYPE=C fgrep -q -i foobar /tmp/test
>vega david ~ $ echo $?
>0
>
>I realize that "foobar\251\n" is not a well-formed utf-8 text file, so
>fgrep is basically allowed to send daemons flying through my nose, but
>I still think it is very wrong that fgrep -i foobar should not match a
>file, be it binary, be it in a utf-8 locale, somehow containing the
>string "foobar", especially as fgrep foobar and egrep -i foobar (and
>egrep foobar) all match.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=575300

Could someone please try to reproduce the bug above with grep 2.6.




reply via email to

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