X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fctmatch.c;h=597990703f09bafbd065695c24f37af97ff6e5d4;hb=1abbc2deb8deef4d440f36e32d031b6803224dcd;hp=7a7d9674f5aa2120c77c04ba54bdada4f2425ccf;hpb=03846211ba84582b133a985200502a39462dfe66;p=libucw.git diff --git a/lib/ctmatch.c b/lib/ctmatch.c index 7a7d9674..59799070 100644 --- a/lib/ctmatch.c +++ b/lib/ctmatch.c @@ -1,13 +1,14 @@ /* - * Sherlock Library -- Content-Type Pattern Matching + * UCW Library -- Content-Type Pattern Matching * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares + * + * This software may be freely distributed and used according to the terms + * of the GNU Lesser General Public License. */ -#include - -#include "lib.h" -#include "string.h" +#include "lib/lib.h" +#include "lib/chartype.h" int match_ct_patt(byte *p, byte *t) @@ -28,10 +29,10 @@ match_ct_patt(byte *p, byte *t) return 0; p++; } - if (*t != '/') + if (*t++ != '/') return 0; - if (*p == '*' && p[1] == '/') /* "*" on the right-hand side */ + if (*p == '*' && !p[1]) /* "*" on the right-hand side */ return 1; while (*p) if (Cupcase(*p++) != Cupcase(*t++))