kernelbase: Parse query strings even without a slash after the host in UrlGetPart().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
562c16f421
commit
77ac962ded
|
@ -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, ""},
|
||||
|
||||
|
|
Loading…
Reference in New Issue