X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=grep.c;h=190139cfcd0d61f364a88010fe1dd6e71e26f9e2;hb=HEAD;hp=3821400966823ff6bf877abf94f4edea9b6b80c6;hpb=fd1727f5fa1ca1817eee36f99c9245dc2217ecac;p=git.git diff --git a/grep.c b/grep.c index 382140096..190139cfc 100644 --- a/grep.c +++ b/grep.c @@ -79,7 +79,7 @@ static void compile_pcre_regexp(struct grep_pat *p, const struct grep_opt *opt) { const char *error; int erroffset; - int options = 0; + int options = PCRE_MULTILINE; if (opt->ignore_case) options |= PCRE_CASELESS; @@ -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;