Wrong results in case wildcard_least_one is:
- false: *rc*.cfg finds quake.rc
- true: quake.*rc finds quake.rc
From: terencehill <piuntn@gmail.com>
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10388
d7cf8633-e32d-0410-b094-
e92efae38249
return matchpattern_with_separator(in, pattern, caseinsensitive, "/\\:", false);
}
+// wildcard_least_one: if true * matches 1 or more characters
+// if false * matches 0 or more characters
int matchpattern_with_separator(const char *in, const char *pattern, int caseinsensitive, const char *separators, qboolean wildcard_least_one)
{
int c1, c2;
break;
case '*': // match anything until following string
if(wildcard_least_one)
+ {
if (*in == 0 || strchr(separators, *in))
return 0; // no match
- if (!*in)
- return 1; // match
+ in++;
+ }
pattern++;
while (*in)
{