kernelbase: Allow the two initial slashes to be backslashes in UrlGetPart().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
71bf5b24d7
commit
b72f7afc8b
|
@ -4191,6 +4191,11 @@ static const WCHAR *parse_url_element( const WCHAR *url, const WCHAR *separators
|
|||
return url + wcslen( url );
|
||||
}
|
||||
|
||||
static BOOL is_slash( char c )
|
||||
{
|
||||
return c == '/' || c == '\\';
|
||||
}
|
||||
|
||||
static void parse_url( const WCHAR *url, struct parsed_url *pl )
|
||||
{
|
||||
const WCHAR *work;
|
||||
|
@ -4200,7 +4205,8 @@ static void parse_url( const WCHAR *url, struct parsed_url *pl )
|
|||
work = scan_url(pl->scheme, &pl->scheme_len, SCHEME);
|
||||
if (!*work || (*work != ':')) return;
|
||||
work++;
|
||||
if ((*work != '/') || (*(work+1) != '/')) return;
|
||||
if (!is_slash( work[0] ) || !is_slash( work[1] ))
|
||||
return;
|
||||
|
||||
pl->username = work + 2;
|
||||
work = parse_url_element( pl->username, L":@/\\?#" );
|
||||
|
|
|
@ -661,12 +661,12 @@ static void test_UrlGetPart(void)
|
|||
{"http:/localhost/index.html", URL_PART_HOSTNAME, 0, E_FAIL, .todo_hr = TRUE},
|
||||
|
||||
{"http://localhost\\index.html", URL_PART_HOSTNAME, 0, S_OK, "localhost"},
|
||||
{"http:/\\localhost/index.html", URL_PART_HOSTNAME, 0, S_OK, "localhost", .todo_hr = TRUE},
|
||||
{"http:\\/localhost/index.html", URL_PART_HOSTNAME, 0, S_OK, "localhost", .todo_hr = TRUE},
|
||||
{"http:/\\localhost/index.html", URL_PART_HOSTNAME, 0, S_OK, "localhost"},
|
||||
{"http:\\/localhost/index.html", URL_PART_HOSTNAME, 0, S_OK, "localhost"},
|
||||
|
||||
{"ftp://localhost\\index.html", URL_PART_HOSTNAME, 0, S_OK, "localhost"},
|
||||
{"ftp:/\\localhost/index.html", URL_PART_HOSTNAME, 0, S_OK, "localhost", .todo_hr = TRUE},
|
||||
{"ftp:\\/localhost/index.html", URL_PART_HOSTNAME, 0, S_OK, "localhost", .todo_hr = TRUE},
|
||||
{"ftp:/\\localhost/index.html", URL_PART_HOSTNAME, 0, S_OK, "localhost"},
|
||||
{"ftp:\\/localhost/index.html", URL_PART_HOSTNAME, 0, S_OK, "localhost"},
|
||||
|
||||
{"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"},
|
||||
|
|
Loading…
Reference in New Issue