]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fixed two unneccessary strlcpy's in the wildcard matching that just were there to...
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 5 Feb 2006 20:52:41 +0000 (20:52 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 5 Feb 2006 20:52:41 +0000 (20:52 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3100 e03df62e-2008-0410-955e-edbf42e46eb7

src/wildcard.cpp

index 06fc78b433b268997ce783d894b81c166136b061..1b1f874ab41ba410b41d4f04bfd220894ab578ce 100644 (file)
@@ -22,6 +22,8 @@ using namespace std;
 #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
@@ -57,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++;
@@ -86,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);
 }
+