On Tue, Nov 18, 2014 at 7:45 AM, Norihiro Tanaka <[email protected]> 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.
