Re: [PATCH v2 7/8] grep: do not enter PCRE2_UTF mode on fixed matching
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 26, 2019, 20:36 UTC
- Message-ID
- <xmqqh878mt2c.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20190726150818.6373-8-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> When grepping a non-ASCII fixed string. This is a more general problem > that's hard to fix, but we can at least fix the most common case of > grepping for a fixed string without "-i". I can't think of a reason > for why we'd turn on PCRE2_UTF when matching byte-for-byte like that.
Yes, exactly. That's quite a sane and minimum fix/workaround, I would think.
Show 8 quoted lines
> test_expect_success GETTEXT_LOCALE,LIBPCRE2 'PCRE v2: grep non-ASCII from invalid UTF-8 data' ' > - test_might_fail git grep -h "æ" invalid-0x80 >actual && > + git grep -h "æ" invalid-0x80 >actual && > test_cmp expected actual && > - test_must_fail git grep -h "(*NO_JIT)æ" invalid-0x80 && > + git grep -h "(*NO_JIT)æ" invalid-0x80 && > test_cmp expected actual > '