mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 20:59:54 +00:00
shlwapi: UrlCanonicalize will canonize address in format "file://localhost/c:/" correctly.
This commit is contained in:
parent
4513fb3818
commit
283012cc95
@ -74,6 +74,10 @@ static const TEST_URL_CANONICALIZE TEST_CANONICALIZE[] = {
|
||||
{"file:///c:/tests\\foo%20bar", URL_UNESCAPE , S_OK, "file:///c:/tests/foo bar", FALSE},
|
||||
{"file:///c:/tests/foo%20bar", 0, S_OK, "file:///c:/tests/foo%20bar", FALSE},
|
||||
{"file:///c:/tests/foo%20bar", URL_FILE_USE_PATHURL, S_OK, "file://c:\\tests\\foo bar", FALSE},
|
||||
{"file://localhost/c:/tests/../tests/foo%20bar", URL_FILE_USE_PATHURL, S_OK, "file://c:\\tests\\foo bar", FALSE},
|
||||
{"file://localhost\\c:/tests/../tests/foo%20bar", URL_FILE_USE_PATHURL, S_OK, "file://c:\\tests\\foo bar", FALSE},
|
||||
{"file://localhost\\\\c:/tests/../tests/foo%20bar", URL_FILE_USE_PATHURL, S_OK, "file://c:\\tests\\foo bar", FALSE},
|
||||
{"file://localhost\\c:\\tests/../tests/foo%20bar", URL_FILE_USE_PATHURL, S_OK, "file://c:\\tests\\foo bar", FALSE},
|
||||
{"file://c:/tests/../tests/foo%20bar", URL_FILE_USE_PATHURL, S_OK, "file://c:\\tests\\foo bar", FALSE},
|
||||
{"file://c:/tests\\../tests/foo%20bar", URL_FILE_USE_PATHURL, S_OK, "file://c:\\tests\\foo bar", FALSE},
|
||||
{"file://c:/tests/foo%20bar", URL_FILE_USE_PATHURL, S_OK, "file://c:\\tests\\foo bar", FALSE},
|
||||
|
@ -319,6 +319,7 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
|
||||
WCHAR slash = '/';
|
||||
|
||||
static const WCHAR wszFile[] = {'f','i','l','e',':'};
|
||||
static const WCHAR wszLocalhost[] = {'l','o','c','a','l','h','o','s','t'};
|
||||
|
||||
TRACE("(%s, %p, %p, 0x%08x) *pcchCanonicalized: %d\n", debugstr_w(pszUrl), pszCanonicalized,
|
||||
pcchCanonicalized, dwFlags, pcchCanonicalized ? *pcchCanonicalized : -1);
|
||||
@ -387,6 +388,12 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
|
||||
*wk2++ = *wk1++;
|
||||
if (*wk1 != '/') {state = 6; break;}
|
||||
*wk2++ = *wk1++;
|
||||
if((dwFlags & URL_FILE_USE_PATHURL) && nByteLen >= sizeof(wszLocalhost)
|
||||
&& !memcmp(wszLocalhost, wk1, sizeof(wszLocalhost))){
|
||||
wk1 += sizeof(wszLocalhost)/sizeof(WCHAR);
|
||||
while(*wk1 == '\\' && (dwFlags & URL_FILE_USE_PATHURL))
|
||||
wk1++;
|
||||
}
|
||||
if(*wk1 == '/' && (dwFlags & URL_FILE_USE_PATHURL))
|
||||
wk1++;
|
||||
state = 4;
|
||||
|
Loading…
Reference in New Issue
Block a user