Commit b72f7afc authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

kernelbase: Allow the two initial slashes to be backslashes in UrlGetPart().

parent 71bf5b24
...@@ -4191,6 +4191,11 @@ static const WCHAR *parse_url_element( const WCHAR *url, const WCHAR *separators ...@@ -4191,6 +4191,11 @@ static const WCHAR *parse_url_element( const WCHAR *url, const WCHAR *separators
return url + wcslen( url ); return url + wcslen( url );
} }
static BOOL is_slash( char c )
{
return c == '/' || c == '\\';
}
static void parse_url( const WCHAR *url, struct parsed_url *pl ) static void parse_url( const WCHAR *url, struct parsed_url *pl )
{ {
const WCHAR *work; const WCHAR *work;
...@@ -4200,7 +4205,8 @@ static void parse_url( const WCHAR *url, struct parsed_url *pl ) ...@@ -4200,7 +4205,8 @@ static void parse_url( const WCHAR *url, struct parsed_url *pl )
work = scan_url(pl->scheme, &pl->scheme_len, SCHEME); work = scan_url(pl->scheme, &pl->scheme_len, SCHEME);
if (!*work || (*work != ':')) return; if (!*work || (*work != ':')) return;
work++; work++;
if ((*work != '/') || (*(work+1) != '/')) return; if (!is_slash( work[0] ) || !is_slash( work[1] ))
return;
pl->username = work + 2; pl->username = work + 2;
work = parse_url_element( pl->username, L":@/\\?#" ); work = parse_url_element( pl->username, L":@/\\?#" );
......
...@@ -661,12 +661,12 @@ static void test_UrlGetPart(void) ...@@ -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, 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"},
{"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", .todo_hr = TRUE}, {"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"},
{"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", .todo_hr = TRUE}, {"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_HOSTNAME, 0, S_OK, "host"},
{"http://host?a:b@c:d", URL_PART_QUERY, 0, S_OK, "a:b@c:d"}, {"http://host?a:b@c:d", URL_PART_QUERY, 0, S_OK, "a:b@c:d"},
......
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