summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-05 20:52:41 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-05 20:52:41 +0000
commit792f8a011a9aceb3dc0a83770f9b39786f8cc90a (patch)
treef842cf3787839ab1ec2bbc8e2e6c5cb8cdb68e1b /src
parentcb7982a32ed1d8c8fa42beb3056c35f44ad6eb21 (diff)
Fixed two unneccessary strlcpy's in the wildcard matching that just were there to lowercase it... we can do this inplace
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3100 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/wildcard.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/wildcard.cpp b/src/wildcard.cpp
index 06fc78b43..1b1f874ab 100644
--- a/src/wildcard.cpp
+++ b/src/wildcard.cpp
@@ -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);
}
+