diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-11-23 14:48:00 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-11-23 14:48:00 -0800 |
commit | a650ff5aecf4be98c78ccfcae388a8d4029a46cf (patch) | |
tree | b693f90020964c5bd2915361af298dbd9bdfcb55 /grep.c | |
parent | Git 2.34 (diff) | |
parent | Revert "grep/pcre2: fix an edge case concerning ascii patterns and UTF-8 data" (diff) | |
download | tgif-a650ff5aecf4be98c78ccfcae388a8d4029a46cf.tar.xz |
Merge branch 'hm/paint-hits-in-log-grep' into maint
"git grep" looking in a blob that has non-UTF8 payload was
completely broken when linked with versions of PCREv2 library older
than 10.34 in the latest release.
* hm/paint-hits-in-log-grep:
Revert "grep/pcre2: fix an edge case concerning ascii patterns and UTF-8 data"
Diffstat (limited to 'grep.c')
-rw-r--r-- | grep.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -382,10 +382,8 @@ static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt } options |= PCRE2_CASELESS; } - if ((!opt->ignore_locale && !has_non_ascii(p->pattern)) || - (!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() && has_non_ascii(p->pattern) && + !(!opt->ignore_case && (p->fixed || p->is_fixed))) options |= (PCRE2_UTF | PCRE2_MATCH_INVALID_UTF); #ifdef GIT_PCRE2_VERSION_10_36_OR_HIGHER |