]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'rs/pcre-invalid-utf8-fix-fix'
authorJunio C Hamano <gitster@pobox.com>
Fri, 25 Feb 2022 23:47:38 +0000 (15:47 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 25 Feb 2022 23:47:38 +0000 (15:47 -0800)
Workaround we have for versions of PCRE2 before their version 10.36
were in effect only for their versions newer than 10.36 by mistake,
which has been corrected.

* rs/pcre-invalid-utf8-fix-fix:
  grep: fix triggering PCRE2_NO_START_OPTIMIZE workaround

1  2 
grep.c

diff --cc grep.c
index d5ad9617d993a2c4c2e49a840e14893b0637f03d,29deb85904c5118ee6f5772e74a6a23bc17f4724..82eb7da1022ecc0c08a83ca7bc46e18602ff275b
--- 1/grep.c
--- 2/grep.c
+++ b/grep.c
@@@ -292,10 -382,11 +292,10 @@@ static void compile_pcre2_pattern(struc
                }
                options |= PCRE2_CASELESS;
        }
 -      if (!opt->ignore_locale && is_utf8_locale() && has_non_ascii(p->pattern) &&
 -          !(!opt->ignore_case && (p->fixed || p->is_fixed)))
 +      if (!opt->ignore_locale && is_utf8_locale() && !literal)
                options |= (PCRE2_UTF | PCRE2_MATCH_INVALID_UTF);
  
- #ifdef GIT_PCRE2_VERSION_10_36_OR_HIGHER
+ #ifndef GIT_PCRE2_VERSION_10_36_OR_HIGHER
        /* Work around https://bugs.exim.org/show_bug.cgi?id=2642 fixed in 10.36 */
        if (PCRE2_MATCH_INVALID_UTF && options & (PCRE2_UTF | PCRE2_CASELESS))
                options |= PCRE2_NO_START_OPTIMIZE;