2 * Sherlock Library -- Content-Type Pattern Matching
4 * (c) 1997 Martin Mares <mj@ucw.cz>
8 #include "lib/chartype.h"
11 match_ct_patt(byte *p, byte *t)
13 if (*p == '*' && !p[1]) /* "*" matches everything */
16 if (*p == '*' && p[1] == '/') /* "*" on the left-hand side */
18 while (*t && *t != ' ' && *t != ';' && *t != '/')
22 else /* Normal left-hand side */
25 if (Cupcase(*p++) != Cupcase(*t++))
32 if (*p == '*' && !p[1]) /* "*" on the right-hand side */
35 if (Cupcase(*p++) != Cupcase(*t++))
37 if (*t && *t != ' ' && *t != ';')