Rob Shearman : shlwapi: Fix UrlCombineW for absolute URLs without slashes.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Aug 24 05:24:41 CDT 2007


Module: wine
Branch: master
Commit: acfc1175a2204422e7ff089f47486b3f153124c1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=acfc1175a2204422e7ff089f47486b3f153124c1

Author: Rob Shearman <rob at codeweavers.com>
Date:   Thu Aug 23 16:42:29 2007 +0100

shlwapi: Fix UrlCombineW for absolute URLs without slashes.

---

 dlls/shlwapi/tests/path.c |    4 ++++
 dlls/shlwapi/url.c        |    5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/dlls/shlwapi/tests/path.c b/dlls/shlwapi/tests/path.c
index d4ed84d..7eb02b2 100644
--- a/dlls/shlwapi/tests/path.c
+++ b/dlls/shlwapi/tests/path.c
@@ -205,6 +205,10 @@ const TEST_URL_COMBINE TEST_COMBINE[] = {
     {"xxx:@MSITStore:file.chm/file.html", "dir/file", 0, S_OK, "xxx:dir/file"},
     {"mk:@MSITStore:file.chm::/file.html", "/dir/file", 0, S_OK, "mk:@MSITStore:file.chm::/dir/file"},
     {"mk:@MSITStore:file.chm::/file.html", "mk:@MSITStore:file.chm::/dir/file", 0, S_OK, "mk:@MSITStore:file.chm::/dir/file"},
+    {"foo:today", "foo:calendar", 0, S_OK, "foo:calendar"},
+    {"foo:today", "bar:calendar", 0, S_OK, "bar:calendar"},
+    {"foo:/today", "foo:calendar", 0, S_OK, "foo:/calendar"},
+    {"foo:/today/", "foo:calendar", 0, S_OK, "foo:/today/calendar"},
 };
 
 struct {
diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c
index e1c0aa6..e7701da 100644
--- a/dlls/shlwapi/url.c
+++ b/dlls/shlwapi/url.c
@@ -736,8 +736,9 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
 		process_case = 4;
 		break;
 	    }
-	    /* case where scheme is followed by document path */
-	    process_case = 5;
+            /* replace either just location if base's location starts with a
+             * slash or otherwise everything */
+            process_case = (*base.pszSuffix == '/') ? 5 : 1;
 	    break;
 	}
         if ((*relative.pszSuffix == '/') && (*(relative.pszSuffix+1) == '/')) {




More information about the wine-cvs mailing list