Fixed wildcard match bug with '****' with smbclient. Found by Andrew (damn him! :-).
authorJeremy Allison <jra@samba.org>
Wed, 9 Feb 2000 15:50:44 +0000 (15:50 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 9 Feb 2000 15:50:44 +0000 (15:50 +0000)
Jeremy.
(This used to be commit c8ca70f99ee2eae5e29ddf0dd4bc231fbcd188f2)

source3/lib/util.c

index a824887e88b76cb5696fcf436e766b0743472c9c..564fc8822227537049523b533bd27424e86d4f49 100644 (file)
@@ -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);