shlwapi: Ignore leading spaces in PathMatchSpec

Peter Oberndorfer kumbayo84 at arcor.de
Tue Apr 11 14:17:52 CDT 2006


Changelog:
shlwapi: Ignore leading spaces in PathMatchSpec
---

 dlls/shlwapi/path.c       |   18 ++++++++----------
 dlls/shlwapi/tests/path.c |    2 +-
 2 files changed, 9 insertions(+), 11 deletions(-)

a4fd8d1df0c007472651d7a6e9cd470fa0ff0d21
diff --git a/dlls/shlwapi/path.c b/dlls/shlwapi/path.c
index 2ce3445..76e3c6a 100644
--- a/dlls/shlwapi/path.c
+++ b/dlls/shlwapi/path.c
@@ -1869,18 +1869,17 @@ BOOL WINAPI PathMatchSpecA(LPCSTR lpszPa
 
   while (*lpszMask)
   {
+    while (*lpszMask == ' ')
+      lpszMask++; /* Eat leading spaces */
+
     if (PathMatchSingleMaskA(lpszPath, lpszMask))
       return TRUE; /* Matches the current mask */
 
     while (*lpszMask && *lpszMask != ';')
-      lpszMask = CharNextA(lpszMask);
+      lpszMask = CharNextA(lpszMask); /* masks separated by ';' */
 
     if (*lpszMask == ';')
-    {
       lpszMask++;
-      while (*lpszMask == ' ')
-        lpszMask++; /*  masks may be separated by "; " */
-    }
   }
   return FALSE;
 }
@@ -1901,18 +1900,17 @@ BOOL WINAPI PathMatchSpecW(LPCWSTR lpszP
 
   while (*lpszMask)
   {
+    while (*lpszMask == ' ')
+      lpszMask++; /* Eat leading spaces */
+
     if (PathMatchSingleMaskW(lpszPath, lpszMask))
       return TRUE; /* Matches the current path */
 
     while (*lpszMask && *lpszMask != ';')
-      lpszMask++;
+      lpszMask++; /* masks separated by ';' */
 
     if (*lpszMask == ';')
-    {
       lpszMask++;
-      while (*lpszMask == ' ')
-        lpszMask++; /* Masks may be separated by "; " */
-    }
   }
   return FALSE;
 }
diff --git a/dlls/shlwapi/tests/path.c b/dlls/shlwapi/tests/path.c
index d7c7e00..2a89618 100644
--- a/dlls/shlwapi/tests/path.c
+++ b/dlls/shlwapi/tests/path.c
@@ -849,7 +849,7 @@ static void test_PathMatchSpec(void)
     ok (PathMatchSpecA(file, spec1) == FALSE, "PathMatchSpec: Spec1 failed\n");
     ok (PathMatchSpecA(file, spec2) == TRUE, "PathMatchSpec: Spec2 failed\n");
     ok (PathMatchSpecA(file, spec3) == FALSE, "PathMatchSpec: Spec3 failed\n");
-    todo_wine ok (PathMatchSpecA(file, spec4) == TRUE, "PathMatchSpec: Spec4 failed\n");
+    ok (PathMatchSpecA(file, spec4) == TRUE, "PathMatchSpec: Spec4 failed\n");
     todo_wine ok (PathMatchSpecA(file, spec5) == TRUE, "PathMatchSpec: Spec5 failed\n");
     todo_wine ok (PathMatchSpecA(file, spec6) == TRUE, "PathMatchSpec: Spec6 failed\n");
     ok (PathMatchSpecA(file, spec7) == FALSE, "PathMatchSpec: Spec7 failed\n");
-- 
1.2.6




More information about the wine-patches mailing list