Zebediah Figura : kernelbase: Parse query strings even without a slash after the host in UrlGetPart().
Alexandre Julliard
julliard at winehq.org
Wed Feb 16 15:30:22 CST 2022
Module: wine
Branch: master
Commit: 77ac962dedb920407e0591a3d0a62afdbd839ea7
URL: https://source.winehq.org/git/wine.git/?a=commit;h=77ac962dedb920407e0591a3d0a62afdbd839ea7
Author: Zebediah Figura <zfigura at codeweavers.com>
Date: Tue Feb 15 21:52:10 2022 -0600
kernelbase: Parse query strings even without a slash after the host in UrlGetPart().
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/kernelbase/path.c | 12 +++++-------
dlls/shlwapi/tests/url.c | 2 +-
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/dlls/kernelbase/path.c b/dlls/kernelbase/path.c
index d14316f05ee..35cce74ab24 100644
--- a/dlls/kernelbase/path.c
+++ b/dlls/kernelbase/path.c
@@ -4243,15 +4243,13 @@ static LONG parse_url(const WCHAR *url, struct parsed_url *pl)
work = parse_url_element( pl->port, L"/\\?#" );
pl->port_len = work - pl->port;
}
- if (*work == '/')
+
+ if ((pl->query = wcschr( work, '?' )))
{
- /* see if query string */
- if ((pl->query = wcschr( work, '?' )))
- {
- ++pl->query;
- pl->query_len = lstrlenW(pl->query);
- }
+ ++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",
pl->scheme, pl->scheme_len, pl->username, pl->username_len, pl->password, pl->password_len, pl->hostname,
diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c
index 1b26204a94f..3bfd8961c8f 100644
--- a/dlls/shlwapi/tests/url.c
+++ b/dlls/shlwapi/tests/url.c
@@ -669,7 +669,7 @@ static void test_UrlGetPart(void)
{"ftp:\\/localhost/index.html", URL_PART_HOSTNAME, 0, S_OK, "localhost", .todo_hr = TRUE},
{"http://host?a:b@c:d", URL_PART_HOSTNAME, 0, S_OK, "host"},
- {"http://host?a:b@c:d", URL_PART_QUERY, 0, S_OK, "a:b at c:d", .todo_hr = TRUE},
+ {"http://host?a:b@c:d", URL_PART_QUERY, 0, S_OK, "a:b at c:d"},
{"http://host#a:b@c:d", URL_PART_HOSTNAME, 0, S_OK, "host"},
{"http://host#a:b@c:d", URL_PART_QUERY, 0, S_FALSE, ""},
More information about the wine-cvs
mailing list