Zebediah Figura : kernelbase: Ignore URL_PARTFLAG_KEEPSCHEME for file URLs.

Alexandre Julliard julliard at winehq.org
Mon Feb 14 15:41:29 CST 2022


Module: wine
Branch: master
Commit: 05e82ba113a4f8cc7fbb87c42ab556cd028d6eba
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=05e82ba113a4f8cc7fbb87c42ab556cd028d6eba

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Sun Feb 13 12:44:01 2022 -0600

kernelbase: Ignore URL_PARTFLAG_KEEPSCHEME for file URLs.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

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

diff --git a/dlls/kernelbase/path.c b/dlls/kernelbase/path.c
index e716351b0bc..c3d3e734cf7 100644
--- a/dlls/kernelbase/path.c
+++ b/dlls/kernelbase/path.c
@@ -4420,7 +4420,7 @@ HRESULT WINAPI UrlGetPartW(const WCHAR *url, WCHAR *out, DWORD *out_len, DWORD p
         return E_INVALIDARG;
     }
 
-    if (flags == URL_PARTFLAG_KEEPSCHEME)
+    if (flags == URL_PARTFLAG_KEEPSCHEME && scheme != URL_SCHEME_FILE)
     {
         if (!pl.scheme || !pl.scheme_len)
         {
diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c
index b2b20b94b1b..4fb4e36c3b6 100644
--- a/dlls/shlwapi/tests/url.c
+++ b/dlls/shlwapi/tests/url.c
@@ -683,7 +683,7 @@ static void test_UrlGetPart(void)
         {"http:///index.html", URL_PART_HOSTNAME, 0, S_FALSE, ""},
         {"http:///index.html", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "http:", .todo_hr = TRUE},
         {"file://h o s t/c:/windows/file", URL_PART_HOSTNAME, 0, S_OK, "h o s t"},
-        {"file://h o s t/c:/windows/file", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "h o s t", .todo_result = TRUE},
+        {"file://h o s t/c:/windows/file", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "h o s t"},
         {"file://foo:bar@localhost:21/file?query=x", URL_PART_USERNAME, 0, E_FAIL, .todo_hr = TRUE},
         {"file://foo:bar@localhost:21/file?query=x", URL_PART_PASSWORD, 0, E_FAIL, .todo_hr = TRUE},
         {"file://foo:bar@localhost:21/file?query=x", URL_PART_HOSTNAME, 0, S_OK, "foo:bar at localhost:21", .todo_result = TRUE},
@@ -737,7 +737,7 @@ static void test_UrlGetPart(void)
         {"vbscript://hostname/", URL_PART_HOSTNAME, 0, E_FAIL},
         {"wais://hostname/", URL_PART_HOSTNAME, 0, E_FAIL},
 
-        {"file://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "hostname", .todo_result = TRUE},
+        {"file://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "hostname"},
         {"ftp://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "ftp:hostname"},
         {"gopher://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "gopher:hostname"},
         {"http://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "http:hostname"},




More information about the wine-cvs mailing list