X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fwildcard.cpp;h=3b95b5f7509011d70b94558fa0e5482fc50a9215;hb=84a19a9ab6129deb71cdc24b216b74dd8eb80978;hp=d0cd504fa318ce35c1bc14167835d9ee9c47b15a;hpb=84b702f39522342c32c7e7f836fdd2ff8f25a721;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/wildcard.cpp b/src/wildcard.cpp index d0cd504fa..3b95b5f75 100644 --- a/src/wildcard.cpp +++ b/src/wildcard.cpp @@ -2,7 +2,7 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * Inspire is copyright (C) 2002-2004 ChatSpike-Dev. + * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev. * E-mail: * * @@ -14,11 +14,16 @@ * --------------------------------------------------- */ +using namespace std; + #include #include "inspircd_config.h" #include "inspircd.h" +#include "helperfuncs.h" #include "inspstring.h" +extern char lowermap[255]; + // Wed 27 Apr 2005 - Brain // I've taken our our old wildcard routine - // although comprehensive, it was topheavy and very @@ -34,7 +39,7 @@ int wildcmp(char *wild, char *string) char *cp, *mp; while ((*string) && (*wild != '*')) { - if ((*wild != *string) && (*wild != '?')) + if ((lowermap[(unsigned)*wild] != lowermap[(unsigned)*string]) && (*wild != '?')) { return 0; } @@ -54,7 +59,7 @@ int wildcmp(char *wild, char *string) cp = string+1; } else - if ((*wild == *string) || (*wild == '?')) + if ((lowermap[(unsigned)*wild] == lowermap[(unsigned)*string]) || (*wild == '?')) { wild++; string++; @@ -83,11 +88,6 @@ int wildcmp(char *wild, char *string) bool match(const char* literal, const char* mask) { - static char L[10240]; - static char M[10240]; - strlcpy(L,literal,10240); - strlcpy(M,mask,10240); - strlower(L); - strlower(M); - return wildcmp(M,L); + return wildcmp((char*)mask, (char*)literal); } +