From 749dad1309583b49cd871173678f6fa3d6283496 Mon Sep 17 00:00:00 2001 From: axel Date: Wed, 29 Mar 2006 04:09:16 +1000 Subject: [PATCH] Fix wildcarding bug where ? at end of wildcard could match 0 characters darcs-hash:20060328180916-ac50b-6f77d936a1e46e411a12ca96fd9ad3bb844d321b.gz --- wildcard.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wildcard.c b/wildcard.c index fffd61c31..efcec6bbf 100644 --- a/wildcard.c +++ b/wildcard.c @@ -124,6 +124,14 @@ static int wildcard_match2( const wchar_t *str, while( *(str++) != 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 ) {