From ac0bee4bf21debd8ef31f8a576b2cac1f6ccf22d Mon Sep 17 00:00:00 2001 From: Peter Oberndorfer Date: Tue, 11 Apr 2006 19:17:52 +0000 Subject: [PATCH] shlwapi: Ignore leading spaces in PathMatchSpec. --- dlls/shlwapi/path.c | 18 ++++++++---------- dlls/shlwapi/tests/path.c | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/dlls/shlwapi/path.c b/dlls/shlwapi/path.c index 2ce3445ae78..76e3c6ace4c 100644 --- a/dlls/shlwapi/path.c +++ b/dlls/shlwapi/path.c @@ -1869,18 +1869,17 @@ BOOL WINAPI PathMatchSpecA(LPCSTR lpszPath, LPCSTR lpszMask) 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 lpszPath, LPCWSTR lpszMask) 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 d7c7e00af3b..2a896186b3f 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"); -- 2.11.4.GIT