summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/util.c5
1 files changed, 3 insertions, 2 deletions
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);