diff options
| author | Junio C Hamano <gitster@pobox.com> | 2019-10-06 12:25:17 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-10-06 12:25:17 +0900 |
| commit | f00b57e5bc56042e21384e3af0e77e6855b213df (patch) | |
| tree | 4634c7e0c521eac8f01d0b02d9d68c7c6e63d64f | |
| parent | Merge branch 'ma/user-manual-markup-update' (diff) | |
| parent | grep: skip UTF8 checks explicitly (diff) | |
| download | git-f00b57e5bc56042e21384e3af0e77e6855b213df.tar.gz git-f00b57e5bc56042e21384e3af0e77e6855b213df.zip | |
Merge branch 'cb/skip-utf8-check-with-pcre1'
Make sure the grep machinery does not abort when seeing a payload
that is not UTF-8 even when JIT is not in use with PCRE1.
* cb/skip-utf8-check-with-pcre1:
grep: skip UTF8 checks explicitly
| -rw-r--r-- | grep.c | 2 | ||||
| -rw-r--r-- | grep.h | 3 |
2 files changed, 4 insertions, 1 deletions
@@ -421,7 +421,7 @@ static void compile_pcre1_regexp(struct grep_pat *p, const struct grep_opt *opt) static int pcre1match(struct grep_pat *p, const char *line, const char *eol, regmatch_t *match, int eflags) { - int ovector[30], ret, flags = 0; + int ovector[30], ret, flags = PCRE_NO_UTF8_CHECK; if (eflags & REG_NOTBOL) flags |= PCRE_NOTBOL; @@ -3,6 +3,9 @@ #include "color.h" #ifdef USE_LIBPCRE1 #include <pcre.h> +#ifndef PCRE_NO_UTF8_CHECK +#define PCRE_NO_UTF8_CHECK 0 +#endif #ifdef PCRE_CONFIG_JIT #if PCRE_MAJOR >= 8 && PCRE_MINOR >= 32 #ifndef NO_LIBPCRE1_JIT |
