diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-03-07 12:12:59 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-03-07 12:12:59 -0800 |
commit | 1e4d0875acbce3c881bc1de66c8900cdc240ebe8 (patch) | |
tree | 1f8ebc2181351b54d600b16a1ec1434e51049352 /grep.c | |
parent | 713194ce54ea67d3fc666ef81aaece16d0e44928 (diff) | |
parent | f1589d100796c58615033dde10c1c6446b814357 (diff) | |
download | git-1e4d0875acbce3c881bc1de66c8900cdc240ebe8.tar.gz |
Merge branch 'jc/pickaxe-ignore-case'
By Junio C Hamano (2) and Ramsay Jones (1)
* jc/pickaxe-ignore-case:
ctype.c: Fix a sparse warning
pickaxe: allow -i to search in patch case-insensitively
grep: use static trans-case table
Diffstat (limited to 'grep.c')
-rw-r--r-- | grep.c | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -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; |