summaryrefslogtreecommitdiff
path: root/test-ctype.c
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2009-01-17 15:50:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-01-18 02:30:41 (GMT)
commitf9b7cce61cbd19c99e89b859b5909f0741111185 (patch)
treeec1bce95ebd9d81581ebd3efad9e578cd8abb6a0 /test-ctype.c
parent8cc32992624ed4140fb136d98675f0f19b20ba09 (diff)
downloadgit-f9b7cce61cbd19c99e89b859b5909f0741111185.zip
git-f9b7cce61cbd19c99e89b859b5909f0741111185.tar.gz
git-f9b7cce61cbd19c99e89b859b5909f0741111185.tar.bz2
Add is_regex_special()
Add is_regex_special(), a character class macro for chars that have a special meaning in regular expressions. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'test-ctype.c')
-rw-r--r--test-ctype.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test-ctype.c b/test-ctype.c
index d6425d5..033c749 100644
--- a/test-ctype.c
+++ b/test-ctype.c
@@ -26,6 +26,11 @@ 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"
@@ -40,6 +45,7 @@ static const struct ctype_class {
{ "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 }
};