18 #include "mysys_priv.h" 
   27 int wild_compare(
register const char *str, 
register const char *wildstr,
 
   31   DBUG_ENTER(
"wild_compare");
 
   35     while (*wildstr && *wildstr != wild_many && *wildstr != wild_one)
 
   37       if (*wildstr == wild_prefix && wildstr[1])
 
   40         if (str_is_pattern && *str++ != wild_prefix)
 
   43       if (*wildstr++ != *str++)
 
   47       DBUG_RETURN(*str != 0);
 
   48     if (*wildstr++ == wild_one)
 
   50       if (! *str || (str_is_pattern && *str == wild_many))
 
   52       if (*str++ == wild_prefix && str_is_pattern && *str)
 
   57       while (str_is_pattern && *str == wild_many)
 
   59       for (; *wildstr ==  wild_many || *wildstr == wild_one; wildstr++)
 
   60         if (*wildstr == wild_many)
 
   62           while (str_is_pattern && *str == wild_many)
 
   67           if (str_is_pattern && *str == wild_prefix && str[1])
 
   74       if ((cmp= *wildstr) == wild_prefix && wildstr[1] && !str_is_pattern)
 
   78         while (*str && *str != cmp)
 
   82         if (wild_compare(str,wildstr,str_is_pattern) == 0)
 
   88   DBUG_RETURN (*str != 0);