[physfs] globbing?

Bradley Bell btb at icculus.org
Wed Jun 11 03:24:43 EDT 2003


Quoting Bradley Bell <btb at icculus.org>:

> I noticed that a pattern like "abc*" doesn't match the file "abc", as I think
> it
> should.
> Here's a li'l patch...
> -brad

actually, any arbitrary number of *s should be okay.  Here's a new patch, that
also makes "a**c" match "abc"

-brad

diff -u -r1.1 globbing.c
--- globbing.c	2003/06/11 02:10:49	1.1
+++ globbing.c	2003/06/11 07:21:36
@@ -39,7 +39,8 @@
         y = *wildptr;
         if (y == '*')
         {
-            wildptr++;
+            while (*wildptr == '*')
+                wildptr++;
             y = (caseSensitive) ? *wildptr : (char) tolower(*wildptr);
 
             while (1)
@@ -77,6 +78,9 @@
 
     } /* while */
 
+    while (*wildptr == '*')
+        wildptr++;
+
     return(*fnameptr == *wildptr);
 } /* matchesPattern */
 





More information about the physfs mailing list