Merge branch 'jk/pretty-commit-header-incomplete-line' into maint
[gitweb.git] / grep.c
diff --git a/grep.c b/grep.c
index f492d267cc157d46f899c70d01ea707d737d27ae..f8ffa46209c0797f2b5f1f1d7470243a4e7654d1 100644 (file)
--- a/grep.c
+++ b/grep.c
@@ -168,15 +168,10 @@ static void compile_regexp(struct grep_pat *p, struct grep_opt *opt)
                p->fixed = 0;
 
        if (p->fixed) {
-               if (opt->regflags & REG_ICASE || p->ignore_case) {
-                       static char trans[256];
-                       int i;
-                       for (i = 0; i < 256; i++)
-                               trans[i] = tolower(i);
-                       p->kws = kwsalloc(trans);
-               } else {
+               if (opt->regflags & REG_ICASE || p->ignore_case)
+                       p->kws = kwsalloc(tolower_trans_tbl);
+               else
                        p->kws = kwsalloc(NULL);
-               }
                kwsincr(p->kws, p->pattern, p->patternlen);
                kwsprep(p->kws);
                return;
@@ -323,7 +318,7 @@ static struct grep_expr *prep_header_patterns(struct grep_opt *opt)
 
        if (!opt->header_list)
                return NULL;
-       p = opt->header_list;
+
        for (p = opt->header_list; p; p = p->next) {
                if (p->token != GREP_PATTERN_HEAD)
                        die("bug: a non-header pattern in grep header list.");