X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fctmatch.c;h=aa9ab16c81798bf0d49e0ca36b4a9087dded25a4;hb=aac1c6571404bfbf5654a671d66c8ff043f9c9eb;hp=7a7d9674f5aa2120c77c04ba54bdada4f2425ccf;hpb=03846211ba84582b133a985200502a39462dfe66;p=libucw.git diff --git a/lib/ctmatch.c b/lib/ctmatch.c index 7a7d9674..aa9ab16c 100644 --- a/lib/ctmatch.c +++ b/lib/ctmatch.c @@ -1,13 +1,14 @@ /* * Sherlock 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++))