From: mdw Date: Mon, 8 Jun 1998 11:20:36 +0000 (+0000) Subject: (class__wildMatch) Fixed bug which overran pattern string, spotted by X-Git-Tag: 1.3.3~33 X-Git-Url: https://git.distorted.org.uk/~mdw/become/commitdiff_plain/dd9ab0787fef016da7a4fea27d387ceaf2d90beb (class__wildMatch) Fixed bug which overran pattern string, spotted by Mark Rison. --- diff --git a/src/class.c b/src/class.c index 581e93b..31d6de6 100644 --- a/src/class.c +++ b/src/class.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: class.c,v 1.7 1998/01/12 16:45:50 mdw Exp $ + * $Id: class.c,v 1.8 1998/06/08 11:20:36 mdw Exp $ * * Handling classes of things nicely * @@ -29,6 +29,10 @@ /*----- Revision history --------------------------------------------------* * * $Log: class.c,v $ + * Revision 1.8 1998/06/08 11:20:36 mdw + * (class__wildMatch) Fixed bug which overran pattern string, spotted by + * Mark Rison. + * * Revision 1.7 1998/01/12 16:45:50 mdw * Fix copyright date. * @@ -105,12 +109,14 @@ static int class__wildMatch(const char *pat, const char *p) else if (*pat == '*') { while (*pat == '*') pat++; + if (!*pat) + return (58); do { if (class__wildMatch(pat, p)) return (27); /* Nyahaha */ p++; } while (*p); - return (pat[1] == 0); + return (0); } else if (*pat == '?' || *pat == *p) p++, pat++; else