[PATCH 2/5] kernelbase: Ignore URL_PARTFLAG_KEEPSCHEME when used with URL_PART_SCHEME or URL_PART_QUERY.

Zebediah Figura zfigura at codeweavers.com
Sun Feb 13 12:44:00 CST 2022


Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 dlls/kernelbase/path.c   | 2 ++
 dlls/shlwapi/tests/url.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/kernelbase/path.c b/dlls/kernelbase/path.c
index 15280a7ea4b..e716351b0bc 100644
--- a/dlls/kernelbase/path.c
+++ b/dlls/kernelbase/path.c
@@ -4334,6 +4334,7 @@ HRESULT WINAPI UrlGetPartW(const WCHAR *url, WCHAR *out, DWORD *out_len, DWORD p
     switch (part)
     {
     case URL_PART_SCHEME:
+        flags &= ~URL_PARTFLAG_KEEPSCHEME;
         if (!pl.scheme_len)
         {
             *out_len = 0;
@@ -4404,6 +4405,7 @@ HRESULT WINAPI UrlGetPartW(const WCHAR *url, WCHAR *out, DWORD *out_len, DWORD p
         break;
 
     case URL_PART_QUERY:
+        flags &= ~URL_PARTFLAG_KEEPSCHEME;
         if (!pl.query_len)
         {
             *out_len = 0;
diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c
index b4b66aec2f1..b2b20b94b1b 100644
--- a/dlls/shlwapi/tests/url.c
+++ b/dlls/shlwapi/tests/url.c
@@ -614,7 +614,7 @@ static void test_UrlGetPart(void)
         {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_PORT, 0, S_OK, "21"},
         {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_QUERY, 0, S_OK, "query=x&return=y", .todo_result = TRUE},
         {"http://foo:bar@localhost:21/internal.php#anchor", URL_PART_QUERY, 0, S_FALSE, ""},
-        {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_SCHEME, URL_PARTFLAG_KEEPSCHEME, S_OK, "http", .todo_result = TRUE},
+        {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_SCHEME, URL_PARTFLAG_KEEPSCHEME, S_OK, "http"},
         {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_USERNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "http:foo"},
         {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_PASSWORD, URL_PARTFLAG_KEEPSCHEME, S_OK, "http:bar"},
         {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "http:localhost"},
-- 
2.34.1




More information about the wine-devel mailing list