summaryrefslogtreecommitdiff
path: root/grep.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-01-21 16:51:03 -0800
committerJunio C Hamano <gitster@pobox.com>2009-01-21 16:51:03 -0800
commitd9fde065bd808fbbad3b53e10e160c8f8193b577 (patch)
treeaeae85b30e694dd7d23a7eb120a499055f147038 /grep.c
parent1afcde6da1221bdb85a3630d995f9ca384042cb9 (diff)
parentf9b7cce61cbd19c99e89b859b5909f0741111185 (diff)
downloadgit-d9fde065bd808fbbad3b53e10e160c8f8193b577.tar.gz
Merge branch 'rs/ctype'
* rs/ctype: Add is_regex_special() Change NUL char handling of isspecial() Reformat ctype.c Add ctype test Conflicts: Makefile
Diffstat (limited to 'grep.c')
-rw-r--r--grep.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/grep.c b/grep.c
index 6485760ff3..062b2b6f28 100644
--- a/grep.c
+++ b/grep.c
@@ -28,15 +28,9 @@ void append_grep_pattern(struct grep_opt *opt, const char *pat,
p->next = NULL;
}
-static int isregexspecial(int c)
-{
- return isspecial(c) || c == '$' || c == '(' || c == ')' || c == '+' ||
- c == '.' || c == '^' || c == '{' || c == '|';
-}
-
static int is_fixed(const char *s)
{
- while (!isregexspecial(*s))
+ while (*s && !is_regex_special(*s))
s++;
return !*s;
}