Skip to content
Permalink
Browse files
Fixes for corner cases (thanks, Bradley!)
  • Loading branch information
icculus committed Jun 11, 2003
1 parent adc1f9a commit 33be461bcbab688a9fca387eb14676b124d81fe7
Showing with 8 additions and 2 deletions.
  1. +8 −2 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 */

0 comments on commit 33be461

Please sign in to comment.