s++;
break;
}
+ /* Syntax error in set; mismatch! */
+ return CURL_FNMATCH_NOMATCH;
- /* Syntax error in set: this must be taken as a regular character. */
- /* FALLTHROUGH */
default:
if(*p++ != *s++)
return CURL_FNMATCH_NOMATCH;
static const struct testcase tests[] = {
/* brackets syntax */
+ {"*[*[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["
+ "[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["
+ "[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[\001\177[[[[[[[[[[[[[[[[[[[[[",
+ "[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["
+ "[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["
+ "[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[",
+ NOMATCH},
+
{ "\\[", "[", MATCH },
- { "[", "[", MATCH },
- { "[]", "[]", MATCH },
+ { "[", "[", NOMATCH },
+ { "[]", "[]", NOMATCH },
{ "[][]", "[", MATCH },
{ "[][]", "]", MATCH },
{ "[[]", "[", MATCH },
for(i = 0; i < testnum; i++) {
rc = Curl_fnmatch(NULL, tests[i].pattern, tests[i].string);
if(rc != tests[i].result) {
- printf("Curl_fnmatch(\"%s\", \"%s\") should return %d (returns %d)\n",
- tests[i].pattern, tests[i].string, tests[i].result, rc);
+ printf("Curl_fnmatch(\"%s\", \"%s\") should return %d (returns %d)"
+ " [%d]\n",
+ tests[i].pattern, tests[i].string, tests[i].result, rc, i);
fail("pattern mismatch");
}
}