GNU bug report logs -
#15773
grep-2.15 bug report
Previous Next
Reported by: Mirraz Mirraz <mirraz1 <at> rambler.ru>
Date: Thu, 31 Oct 2013 18:09:01 UTC
Severity: normal
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
Message #23 received at 15773 <at> debbugs.gnu.org (full text, mbox):
Hi Jim.
On 11/01/2013 03:15 PM, Jim Meyering wrote:
> On Fri, Nov 1, 2013 at 12:53 AM, Aharon Robbins <arnold <at> skeeve.com> wrote:
>> Hello All.
>>
>>>>>> After updating from 2.14 to 2.15 grep has started to fail to match patterns
>>>>>> that contain '\s*' or '\s\+'
>>>
>>> And here's a proper patch, including NEWS and test suite additions:
>>
>> FWIW, I can't reproduce this in gawk (gawk-4.1-stable branch).
>>
>> The program below correctly produces no output, with and without the fix
>> in dfa.c:lex. (I have added the fix anyway.)
>>
>> Any ideas why?
>>
>> Thanks,
>>
>> Arnold
>> ----------------------------------
>> BEGIN {
>> pat["^\\s*$"] = pat["^\\s+$"] = pat["^\\s?$"] = pat["^\\s{1}$"] = 1
>> for (i in pat) {
>> if (" " !~ i) {
>> printf("pattern \"%s\" failed!\n", i) > "/dev/stderr"
>> exit 1
>> }
>> }
>> exit 0
>> }
>
> Thanks for the report.
> With that, I realized that my new grep test case was inadequate:
> it did not force the use of a multibyte locale, and thus did not fail
> even without the fix.
>
This probably calls for a two patch series: the first introducing the test as
an XFAIL, the second fixing the bug without touching the tests, and verifying
that the test succeeds.
> I'm amending the patch (not yet pushed) with this:
>
> diff --git a/tests/backslash-s-and-repetition-operators b/tests/backslash-s-and-repetition-operators
> index 562646d..b1267f8 100755
> --- a/tests/backslash-s-and-repetition-operators
> +++ b/tests/backslash-s-and-repetition-operators
> @@ -9,6 +9,11 @@
>
> . "${srcdir=.}/init.sh"; path_prepend_ ../src
>
> +require_en_utf8_locale_
> +
> +LC_ALL=en_US.UTF-8
> +export LC_ALL
> +
> printf ' \n' > in || framework_failure_
>
> fail=0
>
Maybe you could even amend the test to run with all of the default locale, the
en_US.UTF-8 locale, and the C locale. Possibly overly paranoid, but the
enhancement would be trivial, so why not get the extra coverage anyway?
Thanks,
Stefano
This bug report was last modified 11 years and 135 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.