]> git.ipfire.org Git - thirdparty/git.git/commitdiff
grep: consistently use "p->fixed" in compile_regexp()
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Fri, 26 Jul 2019 15:08:14 +0000 (17:08 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 26 Jul 2019 20:56:40 +0000 (13:56 -0700)
At the start of this function we do:

    p->fixed = opt->fixed;

It's less confusing to use that variable consistently that switch back
& forth between the two.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
grep.c

diff --git a/grep.c b/grep.c
index 9c2b25977103e7504296c8e72b4a4aab312d5d31..b94e998680c3c27c644236910e2dea20b44fc6cb 100644 (file)
--- a/grep.c
+++ b/grep.c
@@ -616,7 +616,7 @@ static void compile_regexp(struct grep_pat *p, struct grep_opt *opt)
                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 (opt->fixed || pat_is_fixed) {
+       if (p->fixed || pat_is_fixed) {
 #ifdef USE_LIBPCRE2
                opt->pcre2 = 1;
                if (pat_is_fixed) {