summaryrefslogtreecommitdiff
path: root/grep.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-03-07 12:12:59 -0800
committerJunio C Hamano <gitster@pobox.com>2012-03-07 12:12:59 -0800
commit1e4d0875acbce3c881bc1de66c8900cdc240ebe8 (patch)
tree1f8ebc2181351b54d600b16a1ec1434e51049352 /grep.c
parent713194ce54ea67d3fc666ef81aaece16d0e44928 (diff)
parentf1589d100796c58615033dde10c1c6446b814357 (diff)
downloadgit-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.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/grep.c b/grep.c
index f492d267cc..190139cfcd 100644
--- 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;