2 * UCW Library -- Content-Type Pattern Matching
4 * (c) 1997 Martin Mares <mj@ucw.cz>
6 * This software may be freely distributed and used according to the terms
7 * of the GNU Lesser General Public License.
11 #include "lib/chartype.h"
14 match_ct_patt(byte *p, byte *t)
16 if (*p == '*' && !p[1]) /* "*" matches everything */
19 if (*p == '*' && p[1] == '/') /* "*" on the left-hand side */
21 while (*t && *t != ' ' && *t != ';' && *t != '/')
25 else /* Normal left-hand side */
28 if (Cupcase(*p++) != Cupcase(*t++))
35 if (*p == '*' && !p[1]) /* "*" on the right-hand side */
38 if (Cupcase(*p++) != Cupcase(*t++))
40 if (*t && *t != ' ' && *t != ';')