diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2019-07-26 17:08:15 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-07-26 13:56:40 -0700 |
commit | 09872f6418f6b6fc1b823d3b324907c02e9bc75b (patch) | |
tree | 012182377d24f3f5fab59cca4e376f54c66a225c /grep.c | |
parent | 8a35b540a99d909ee4680e773c1d3befb6bff782 (diff) | |
download | git-09872f6418f6b6fc1b823d3b324907c02e9bc75b.tar.gz |
grep: create a "is_fixed" member in "grep_pat"
This change paves the way for later using this value the regex compile
functions themselves.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'grep.c')
-rw-r--r-- | grep.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -606,7 +606,6 @@ static void compile_regexp(struct grep_pat *p, struct grep_opt *opt) { int err; int regflags = REG_NEWLINE; - int pat_is_fixed; p->word_regexp = opt->word_regexp; p->ignore_case = opt->ignore_case; @@ -615,11 +614,11 @@ static void compile_regexp(struct grep_pat *p, struct grep_opt *opt) if (memchr(p->pattern, 0, p->patternlen) && !opt->pcre2) die(_("given pattern contains NULL byte (via -f <file>). This is only supported with -P under PCRE v2")); - pat_is_fixed = is_fixed(p->pattern, p->patternlen); - if (p->fixed || pat_is_fixed) { + p->is_fixed = is_fixed(p->pattern, p->patternlen); + if (p->fixed || p->is_fixed) { #ifdef USE_LIBPCRE2 opt->pcre2 = 1; - if (pat_is_fixed) { + if (p->is_fixed) { compile_pcre2_pattern(p, opt); } else { /* |