bug-grep
[Top][All Lists]
Advanced

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

bug#19095: [PATCH] grep: grep -F fails to match at the next position aft


From: Jim Meyering
Subject: bug#19095: [PATCH] grep: grep -F fails to match at the next position after matched middle of a multi-byte character
Date: Tue, 18 Nov 2014 09:26:26 -0800

On Tue, Nov 18, 2014 at 7:45 AM, Norihiro Tanaka <address@hidden> wrote:
> grep -F skips an extra character after matched middle of multi-byte
> character.  As a result, fails to match at the next position.  A test
> case for this bug is already included in tests/sjis-mb.
>
> For example, Following test is failure on grep-2.19 or later.
>
> $ printf '\203AA\n' >in
> $ env LC_ALL=ja_JP.SHIFT-JIS src/grep -F A in
>
> We expect that it matches at the second A and outputs the line, but
> doesn't output.

Thank you!
I'm glad you caught that before the release.

Condensing your example, and being careful to run on a system for
which such a locale is actually installed (check via "locale -a|grep
-i jis"; I had to adjust the locale name on this debian unstable
system). Before the patch:

  $ printf '\203AA\n'|LC_ALL=ja_JP.SHIFT_JIS src/grep -qF A||echo fail
  fail

After the patch, it matches and the above command prints nothing.

This is a good argument for making the test framework work harder
to find a locale like that, and if not found, to suggest how to install
it, so the test is not skipped so often.

Did you determine which commit introduced the bug?
In this project, we make a point of including that information
in the commit log for any bug fix.





reply via email to

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