diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c index 2cb6fea16ff..f9fc79a22dd 100644 --- a/dlls/shlwapi/tests/url.c +++ b/dlls/shlwapi/tests/url.c @@ -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}, diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c index 879a7342cd3..2caf998e4ba 100644 --- a/dlls/shlwapi/url.c +++ b/dlls/shlwapi/url.c @@ -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) {