Fix wildcarding bug where ? at end of wildcard could match 0 characters

darcs-hash:20060328180916-ac50b-6f77d936a1e46e411a12ca96fd9ad3bb844d321b.gz
This commit is contained in:
axel 2006-03-29 04:09:16 +10:00
parent 7a07d7c188
commit 749dad1309

View file

@ -124,6 +124,14 @@ static int wildcard_match2( const wchar_t *str,
while( *(str++) != 0 ); while( *(str++) != 0 );
return 0; return 0;
} }
else if( *str == 0 )
{
/*
End of string, but not end of wildcard, and the next wildcard
element is not a '*', so this is not a match.
*/
return 0;
}
if( *wc == ANY_CHAR ) if( *wc == ANY_CHAR )
{ {