Skip to content

Commit

Permalink
Fixes for corner cases (thanks, Bradley!)
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jun 11, 2003
1 parent adc1f9a commit 33be461
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions extras/globbing.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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 */

Expand Down

0 comments on commit 33be461

Please sign in to comment.