]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
There is no breakage here *jedi mind trick*
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 22 Aug 2008 17:45:14 +0000 (17:45 +0000)
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 22 Aug 2008 17:45:14 +0000 (17:45 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10219 e03df62e-2008-0410-955e-edbf42e46eb7

src/wildcard.cpp

index 4d8d94eb42e3c0633f3f35d29e60b64d03a4a55d..4b00e7261b947156a40d21477e2457efbec5b842 100644 (file)
@@ -17,7 +17,6 @@
 #include "hashcomp.h"
 #include "inspstring.h"
 
-#include <iostream>
 /*
  * Wildcard matching, the third (and probably final) iteration!
  *
@@ -34,7 +33,7 @@ static bool match_internal(const unsigned char *mask, const unsigned char *str,
 
        while ((*string) && (*wild != '*'))
        {
-               if (map[*wild] != map[*string] && (*wild != '?'))
+               if ((map[*wild] != map[*string]) && (*wild != '?'))
                {
                        return false;
                }
@@ -55,9 +54,8 @@ static bool match_internal(const unsigned char *mask, const unsigned char *str,
                        mp = wild;
                        cp = string+1;
                }
-
-               // if mapped char == mapped wild AND wild is NOT ?
-               else if (map[*wild] == map[*string] && (*wild == '?'))
+               // if mapped char == mapped wild OR wild is ?
+               else if ((map[*wild] == map[*string]) || (*wild == '?'))
                {
                        ++wild;
                        ++string;
@@ -74,10 +72,6 @@ static bool match_internal(const unsigned char *mask, const unsigned char *str,
                wild++;
        }
 
-       if (*wild == 0)
-               std::cout << "*wild == 0\n";
-       else
-               std::cout << "*wild != 0\n";
        return (*wild == 0);
 }