mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-08 03:47:32 +00:00
COMMON: Fix String::matchString matching excluded characters with trailing asterisk wildcards
This commit is contained in:
parent
a3706e0976
commit
79e06f899a
@ -638,6 +638,7 @@ bool matchString(const char *str, const char *pat, bool ignoreCase, const char *
|
||||
const char *p = nullptr;
|
||||
const char *q = nullptr;
|
||||
bool escaped = false;
|
||||
bool noExclusions = (wildcardExclusions == nullptr || !*wildcardExclusions);
|
||||
|
||||
for (;;) {
|
||||
if (wildcardExclusions && strchr(wildcardExclusions, *str)) {
|
||||
@ -662,8 +663,8 @@ bool matchString(const char *str, const char *pat, bool ignoreCase, const char *
|
||||
p = nullptr;
|
||||
q = nullptr;
|
||||
}
|
||||
// If pattern ended with * -> match
|
||||
if (!*pat)
|
||||
// If pattern ended with * and there are no exclusions -> match
|
||||
if (!*pat && noExclusions)
|
||||
return true;
|
||||
break;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user