diff --git a/grep.c b/grep.c index 82eb7da102..b9553ec9f5 100644 --- a/grep.c +++ b/grep.c @@ -297,7 +297,9 @@ static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt #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)) + if (PCRE2_MATCH_INVALID_UTF && + ((options & (PCRE2_UTF | PCRE2_CASELESS)) == + (PCRE2_UTF | PCRE2_CASELESS))) options |= PCRE2_NO_START_OPTIMIZE; #endif