Commit 4eac6e84 authored by Daniel Lehman's avatar Daniel Lehman Committed by Alexandre Julliard

shlwapi: Remove dot segments for URLs starting with /.

parent 2b09cfe9
......@@ -193,6 +193,15 @@ static const TEST_URL_CANONICALIZE TEST_CANONICALIZE[] = {
{"res://c:\\tests/res\\foo%20bar/strange\\sth", 0, S_OK, "res://c:\\tests/res\\foo%20bar/strange\\sth", FALSE},
{"res://c:\\tests/res\\foo%20bar/strange\\sth", URL_FILE_USE_PATHURL, S_OK, "res://c:\\tests/res\\foo%20bar/strange\\sth", FALSE},
{"res://c:\\tests/res\\foo%20bar/strange\\sth", URL_UNESCAPE, S_OK, "res://c:\\tests/res\\foo bar/strange\\sth", FALSE},
{"/A/../B/./C/../../test_remove_dot_segments", 0, S_OK, "/test_remove_dot_segments", FALSE},
{"/A/../B/./C/../../test_remove_dot_segments", URL_FILE_USE_PATHURL, S_OK, "/test_remove_dot_segments", FALSE},
{"/A/../B/./C/../../test_remove_dot_segments", URL_WININET_COMPATIBILITY, S_OK, "/test_remove_dot_segments", FALSE},
{"/A/B\\C/D\\E", 0, S_OK, "/A/B\\C/D\\E", FALSE},
{"/A/B\\C/D\\E", URL_FILE_USE_PATHURL, S_OK, "/A/B\\C/D\\E", FALSE},
{"/A/B\\C/D\\E", URL_WININET_COMPATIBILITY, S_OK, "/A/B\\C/D\\E", FALSE},
{"///A/../B", 0, S_OK, "///B", FALSE},
{"///A/../B", URL_FILE_USE_PATHURL, S_OK, "///B", FALSE},
{"///A/../B", URL_WININET_COMPATIBILITY, S_OK, "///B", FALSE},
{"A", 0, S_OK, "A", FALSE},
{"../A", 0, S_OK, "../A", FALSE},
{"A/../B", 0, S_OK, "B", TRUE},
......
......@@ -372,6 +372,9 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
dwFlags |= URL_ESCAPE_UNSAFE;
state = 5;
is_file_url = TRUE;
} else if(url[0] == '/') {
state = 5;
is_file_url = TRUE;
}
while (*wk1) {
......
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