From 8cc32992624ed4140fb136d98675f0f19b20ba09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sat, 17 Jan 2009 16:50:34 +0100 Subject: Change NUL char handling of isspecial() Replace isspecial() by the new macro is_glob_special(), which is more, well, specialized. The former included the NUL char in its character class, while the letter only included characters that are special to file name globbing. The new name contains underscores because they enhance readability considerably now that it's made up of three words. Renaming the function is necessary to document its changed scope. The call sites of isspecial() are updated to check explicitly for NUL. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- test-ctype.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test-ctype.c') diff --git a/test-ctype.c b/test-ctype.c index 723eff4e9..d6425d5b4 100644 --- a/test-ctype.c +++ b/test-ctype.c @@ -21,6 +21,11 @@ static int test_isalnum(int c) return isalnum(c); } +static int test_is_glob_special(int c) +{ + return is_glob_special(c); +} + #define DIGIT "0123456789" #define LOWER "abcdefghijklmnopqrstuvwxyz" #define UPPER "ABCDEFGHIJKLMNOPQRSTUVWXYZ" @@ -34,6 +39,7 @@ 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, "*?[\\" }, { NULL } }; -- cgit v1.2.1