Zebediah Figura : kernelbase: Do not return the question mark as part of the query string from UrlGetPart().

Alexandre Julliard julliard at winehq.org
Tue Feb 15 16:07:17 CST 2022


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

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Mon Feb 14 20:37:10 2022 -0600

kernelbase: Do not return the question mark as part of the query string from UrlGetPart().

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

---

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

diff --git a/dlls/kernelbase/path.c b/dlls/kernelbase/path.c
index 823fb51a68e..d14316f05ee 100644
--- a/dlls/kernelbase/path.c
+++ b/dlls/kernelbase/path.c
@@ -4246,8 +4246,11 @@ static LONG parse_url(const WCHAR *url, struct parsed_url *pl)
     if (*work == '/')
     {
         /* see if query string */
-        pl->query = wcschr(work, '?');
-        if (pl->query) pl->query_len = lstrlenW(pl->query);
+        if ((pl->query = wcschr( work, '?' )))
+        {
+            ++pl->query;
+            pl->query_len = lstrlenW(pl->query);
+        }
     }
   SuccessExit:
     TRACE("parse successful: scheme=%p(%ld), user=%p(%ld), pass=%p(%ld), host=%p(%ld), port=%p(%ld), query=%p(%ld)\n",
diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c
index 18ff5021986..1b26204a94f 100644
--- a/dlls/shlwapi/tests/url.c
+++ b/dlls/shlwapi/tests/url.c
@@ -612,14 +612,14 @@ static void test_UrlGetPart(void)
         {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_PASSWORD, 0, S_OK, "bar"},
         {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_HOSTNAME, 0, S_OK, "localhost"},
         {"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?query=x&return=y", URL_PART_QUERY, 0, S_OK, "query=x&return=y"},
         {"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"},
         {"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"},
         {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_PORT, URL_PARTFLAG_KEEPSCHEME, S_OK, "http:21"},
-        {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_QUERY, URL_PARTFLAG_KEEPSCHEME, S_OK, "query=x&return=y", .todo_result = TRUE},
+        {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_QUERY, URL_PARTFLAG_KEEPSCHEME, S_OK, "query=x&return=y"},
 
         {"http://localhost/", URL_PART_USERNAME, 0, E_INVALIDARG, .todo_hr = TRUE},
         {"http://localhost/", URL_PART_PASSWORD, 0, E_INVALIDARG, .todo_hr = TRUE},
@@ -688,7 +688,7 @@ static void test_UrlGetPart(void)
         {"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},
         {"file://foo:bar@localhost:21/file?query=x", URL_PART_PORT, 0, E_FAIL, .todo_hr = TRUE},
-        {"file://foo:bar@localhost:21/file?query=x", URL_PART_QUERY, 0, S_OK, "query=x", .todo_result = TRUE},
+        {"file://foo:bar@localhost:21/file?query=x", URL_PART_QUERY, 0, S_OK, "query=x"},
         {"http://user:pass 123 at www.wine hq.org", URL_PART_HOSTNAME, 0, S_OK, "www.wine hq.org"},
         {"http://user:pass 123 at www.wine hq.org", URL_PART_PASSWORD, 0, S_OK, "pass 123"},
         {"about:blank", URL_PART_SCHEME, 0, S_OK, "about"},




More information about the wine-cvs mailing list