From 33be461bcbab688a9fca387eb14676b124d81fe7 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 11 Jun 2003 09:05:47 +0000 Subject: [PATCH] Fixes for corner cases (thanks, Bradley!) --- extras/globbing.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/extras/globbing.c b/extras/globbing.c index a56499f2..17f351ec 100644 --- a/extras/globbing.c +++ b/extras/globbing.c @@ -39,7 +39,11 @@ static int matchesPattern(const char *fname, const char *wildcard, y = *wildptr; if (y == '*') { - wildptr++; + do + { + wildptr++; /* skip multiple '*' in a row... */ + } while (*wildptr == '*'); + y = (caseSensitive) ? *wildptr : (char) tolower(*wildptr); while (1) @@ -74,9 +78,11 @@ static int matchesPattern(const char *fname, const char *wildcard, if (x != y) return(0); } /* else */ - } /* while */ + while (*wildptr == '*') + wildptr++; + return(*fnameptr == *wildptr); } /* matchesPattern */