summaryrefslogtreecommitdiff
path: root/src/wildcard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wildcard.cpp')
-rw-r--r--src/wildcard.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wildcard.cpp b/src/wildcard.cpp
index 9846b7d4f..3a91e8350 100644
--- a/src/wildcard.cpp
+++ b/src/wildcard.cpp
@@ -35,6 +35,9 @@ CoreExport bool csmatch(const std::string &str, const std::string &mask)
std::string::const_iterator wild = mask.begin();
std::string::const_iterator string = str.begin();
+ if (mask.empty())
+ return false;
+
while ((string != str.end()) && (wild != mask.end()) && (*wild != '*'))
{
if ((*wild != *string) && (*wild != '?'))
@@ -81,6 +84,9 @@ CoreExport bool match(const std::string &str, const std::string &mask)
std::string::const_iterator wild = mask.begin();
std::string::const_iterator string = str.begin();
+ if (mask.empty())
+ return false;
+
while ((string != str.end()) && (wild != mask.end()) && (*wild != '*'))
{
if ((lowermap[(unsigned char)*wild] != lowermap[(unsigned char)*string]) && (*wild != '?'))