X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/6cd50960637fb16a0d0d64e23b42e8005bf469d6..20b2e9cef70ef6ab6e28904a508569a86a5df7d0:/wildtest.c diff --git a/wildtest.c b/wildtest.c index 85c65151..1f7516e0 100644 --- a/wildtest.c +++ b/wildtest.c @@ -24,6 +24,8 @@ beg(int n, const char *text, const char *pattern, bool matches, bool same_as_fnm #ifdef COMPARE_WITH_FNMATCH bool fn_matched; int flags = strstr(pattern, "**")? 0 : FNM_PATHNAME; +#else + same_as_fnmatch = 0; /* Get rid of unused-variable compiler warning. */ #endif matched = wildmatch(pattern, text); @@ -50,6 +52,8 @@ end(int n, const char *text, const char *pattern, bool matches, bool same_as_fnm #ifdef COMPARE_WITH_FNMATCH bool fn_matched = false; int flags = strstr(pattern, "**")? 0 : FNM_PATHNAME; +#else + same_as_fnmatch = 0; /* Get rid of unused-variable compiler warning. */ #endif if (strncmp(pattern, "**", 2) == 0) { @@ -166,10 +170,10 @@ main(int argc, char **argv) /* Additional tests, including some malformed wildmats. */ /* TEST, "text", "pattern", MATCH?, SAME-AS-FNMATCH? */ - beg(500, "]", "[\\-_]", true, false); + beg(500, "]", "[\\-_]", true, true); beg(501, "[", "[\\-_]", false, true); beg(502, ".", "[\\\\-_]", false, true); - beg(503, "^", "[\\\\-_]", true, false); + beg(503, "^", "[\\\\-_]", true, true); beg(504, "Z", "[\\\\-_]", false, true); beg(505, "\\", "[\\]]", false, true); beg(506, "ab", "a[]b", false, true); @@ -198,15 +202,15 @@ main(int argc, char **argv) beg(529, "[", "[!]-a]", true, true); beg(530, "^", "[a^bc]", true, true); beg(531, "-b]", "[a-]b]", true, true); - beg(532, "\\]", "[\\]]", true, false); - beg(533, "\\", "[\\]", true, false); - beg(534, "\\", "[!\\]", false, false); /*FN?*/ - beg(535, "G", "[A-\\]", true, false); + beg(532, "\\]", "[\\]]", true, true); + beg(533, "\\", "[\\]", true, true); + beg(534, "\\", "[!\\]", false, true); + beg(535, "G", "[A-\\]", true, true); beg(536, "aaabbb", "b*a", false, true); beg(537, "aabcaa", "*ba*", false, true); beg(538, ",", "[,]", true, true); beg(539, ",", "[\\,]", true, true); - beg(540, "\\", "[\\,]", true, false); + beg(540, "\\", "[\\,]", true, true); beg(541, "-", "[,-.]", true, true); beg(542, "+", "[,-.]", false, true); beg(543, "-.]", "[,-.]", false, true);