Skip to content

Commit 97169fc

Browse files
rscharfegitster
authored andcommitted
grep: fix triggering PCRE2_NO_START_OPTIMIZE workaround
PCRE2 bug 2642 was fixed in version 10.36. Our 95ca1f9 (grep/pcre2: better support invalid UTF-8 haystacks, 2021-01-24) worked around it on older versions by setting the flag PCRE2_NO_START_OPTIMIZE. 797c359 (grep/pcre2: use compile-time PCREv2 version test, 2021-02-18) switched it around to set the flag on 10.36 and higher instead, while it claimed to use "the same test done at compile-time". Switch the condition back to apply the workaround on PCRE2 versions _before_ 10.36. Signed-off-by: René Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c176035 commit 97169fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

grep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt
386386
!(!opt->ignore_case && (p->fixed || p->is_fixed)))
387387
options |= (PCRE2_UTF | PCRE2_MATCH_INVALID_UTF);
388388

389-
#ifdef GIT_PCRE2_VERSION_10_36_OR_HIGHER
389+
#ifndef GIT_PCRE2_VERSION_10_36_OR_HIGHER
390390
/* Work around https://bugs.exim.org/show_bug.cgi?id=2642 fixed in 10.36 */
391391
if (PCRE2_MATCH_INVALID_UTF && options & (PCRE2_UTF | PCRE2_CASELESS))
392392
options |= PCRE2_NO_START_OPTIMIZE;

0 commit comments

Comments
 (0)