From fe05c85250f04935030be6abc5d3924a06897bdd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 9 Feb 2000 15:50:44 +0000 Subject: Fixed wildcard match bug with '****' with smbclient. Found by Andrew (damn him! :-). Jeremy. (This used to be commit c8ca70f99ee2eae5e29ddf0dd4bc231fbcd188f2) --- source3/lib/util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/lib/util.c') diff --git a/source3/lib/util.c b/source3/lib/util.c index a824887e88..564fc88222 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1321,8 +1321,9 @@ BOOL mask_match(char *str, char *regexp, BOOL case_sig, BOOL trans2) #endif /* Remove any *? and ** as they are meaningless */ - pstring_sub(t_pattern, "*?", "*"); - pstring_sub(t_pattern, "**", "*"); + for(p = t_pattern; *p; p++) + while( *p == '*' && (p[1] == '?' || p[1] == '*')) + (void)pstrcpy( &p[1], &p[2]); if (strequal(t_pattern,"*")) return(True); -- cgit