summaryrefslogtreecommitdiff
path: root/src/wildcard.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-08-22 16:14:36 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-08-22 16:14:36 +0000
commita1a7b96a8c994eb09a3d071f3daf28252b8c188b (patch)
treec40214c3e8295c565496983ae627b05ccef6c2d1 /src/wildcard.cpp
parent58f4306bb6e1f91076fccf30a3b43a40b3d1915a (diff)
Match conversion stuff.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10216 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/wildcard.cpp')
-rw-r--r--src/wildcard.cpp24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/wildcard.cpp b/src/wildcard.cpp
index 199b43965..e717b0ad4 100644
--- a/src/wildcard.cpp
+++ b/src/wildcard.cpp
@@ -28,21 +28,14 @@ static bool match_internal(const unsigned char *str, const unsigned char *mask,
const unsigned char *cp = NULL;
const unsigned char *mp = NULL;
+ if (!map)
+ map = lowermap; // default to case insensitive search
+
while ((*string) && (*wild != '*'))
{
- if (!map)
+ if (map[*wild] != map[*string] && (*wild != '?'))
{
- if ((*wild != *string) && (*wild != '?'))
- {
- return false;
- }
- }
- else
- {
- if (map[*wild] != map[*string] && (*wild != '?'))
- {
- return false;
- }
+ return false;
}
++wild;
@@ -61,10 +54,9 @@ static bool match_internal(const unsigned char *str, const unsigned char *mask,
mp = wild;
cp = string+1;
}
- // if there is no charmap and str == wild OR
- // there is a map and mapped char == mapped wild AND
- // wild is NOT ?
- else if (((!map && *wild == *string) || (map && map[*wild] == map[*string])) && (*wild == '?'))
+
+ // if mapped char == mapped wild AND wild is NOT ?
+ else if (map[*wild] == map[*string] && (*wild == '?'))
{
++wild;
++string;