Change NUL char handling of isspecial()
[gitweb.git] / grep.c
diff --git a/grep.c b/grep.c
index 6485760ff30e0575ee13b43fc8c7fb8e2e291346..f9a45258aa0485df6f6205aa8121bdad07a480b0 100644 (file)
--- a/grep.c
+++ b/grep.c
@@ -30,8 +30,9 @@ void append_grep_pattern(struct grep_opt *opt, const char *pat,
 
 static int isregexspecial(int c)
 {
-       return isspecial(c) || c == '$' || c == '(' || c == ')' || c == '+' ||
-                              c == '.' || c == '^' || c == '{' || c == '|';
+       return c == '\0' || is_glob_special(c) ||
+               c == '$' || c == '(' || c == ')' || c == '+' ||
+               c == '.' || c == '^' || c == '{' || c == '|';
 }
 
 static int is_fixed(const char *s)