Code

grep: do not segfault when -f is used
[git.git] / test-ctype.c
index 723eff4e96ca4389f2ffba70fbda3e44b2a96ebf..033c74911ed035ed36b16b0e2bf7327d6cdc5823 100644 (file)
@@ -21,6 +21,16 @@ static int test_isalnum(int c)
        return isalnum(c);
 }
 
+static int test_is_glob_special(int c)
+{
+       return is_glob_special(c);
+}
+
+static int test_is_regex_special(int c)
+{
+       return is_regex_special(c);
+}
+
 #define DIGIT "0123456789"
 #define LOWER "abcdefghijklmnopqrstuvwxyz"
 #define UPPER "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
@@ -34,6 +44,8 @@ static const struct ctype_class {
        { "isspace", test_isspace, " \n\r\t" },
        { "isalpha", test_isalpha, LOWER UPPER },
        { "isalnum", test_isalnum, LOWER UPPER DIGIT },
+       { "is_glob_special", test_is_glob_special, "*?[\\" },
+       { "is_regex_special", test_is_regex_special, "$()*+.?[\\^{|" },
        { NULL }
 };