]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/wildcard.cpp
Give tons more information in the xml feed, should be enough to construct just about...
[user/henk/code/inspircd.git] / src / wildcard.cpp
index 9846b7d4f4213ee603cc6766cbacaad4b6afdf96..3a91e8350ca5c51634216b6841d8622f399bd61a 100644 (file)
@@ -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 != '?'))