Commit 77ac962d authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

kernelbase: Parse query strings even without a slash after the host in UrlGetPart().

parent 562c16f4
......@@ -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,
......
......@@ -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@c:d", .todo_hr = TRUE},
{"http://host?a:b@c:d", URL_PART_QUERY, 0, S_OK, "a:b@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, ""},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment