bug-grep
[Top][All Lists]
Advanced

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

Re: [RFC PATCH 0/3] bug #30771 and related


From: Jim Meyering
Subject: Re: [RFC PATCH 0/3] bug #30771 and related
Date: Fri, 27 Aug 2010 08:06:05 +0200

Jim Meyering wrote:
...
> Thanks for working on that.
> I was surprised to find that I cannot reproduce
> the problem at all.  I've tried using stock grep-2.6.3 both
> manually on the command line using f13 on both i686 and x86_64.
>
>     $ /bin/grep -Fif /dev/null < /dev/null
>     [Exit 1]
>     $
>
> Is there some trick to reproducing it?
>
> I also applied all of your patches, including
> the test additions, but then backed out the
>
>   search: fix "grep -Fif /dev/null"
>
> changes, recompiled and ran "make check".
> Surprisingly, no test failed.
>
> puzzled...

Thanks for your patience.

The problem is due to inconsistent locale settings.
In the test, LC_ALL is set to C, so the bug is not triggered.
>From your command line, it was set to some UTF-8 character set,
so the bug *was* triggered.  When I merge the following patch onto
your "tests: add test for previous commit" commit, the test works as
advertised even for me (with LC_ALL=C in my env.).

Unless you say otherwise in the next few hours, I'll push this
adjusted 3-patch series.



>From 0b7336ddec503378a9f93af02de8ef5a332f9b5d Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 26 Aug 2010 20:04:41 +0200
Subject: [PATCH] .

---
 tests/grep-dev-null |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tests/grep-dev-null b/tests/grep-dev-null
index f5c1528..e649be0 100644
--- a/tests/grep-dev-null
+++ b/tests/grep-dev-null
@@ -2,6 +2,11 @@
 # Case-insensitive grep with a 0-size input file would fail in grep up to 2.6.3
 . "${srcdir=.}/init.sh"; path_prepend_ ../src

+require_en_utf8_locale_
+
+LC_ALL=en_US.UTF-8
+export LC_ALL
+
 echo x | grep -f /dev/null; test $? = 1 || fail=1
 echo x | grep -if /dev/null; test $? = 1 || fail=1
 echo x | grep -Ff /dev/null; test $? = 1 || fail=1
--
1.7.2.rc1.218.gca56a



reply via email to

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