From 594a19645e9ff54bcf3787c74028af725f329067 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Fri, 19 Mar 2010 10:57:13 -0500 Subject: [PATCH] shlwapi: Only skip 'localhost' in file URLs in UrlCanonicalize. --- dlls/shlwapi/tests/url.c | 1 + dlls/shlwapi/url.c | 1 + 2 files changed, 2 insertions(+) diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c index f1bd6481059..f7c94551e3d 100644 --- a/dlls/shlwapi/tests/url.c +++ b/dlls/shlwapi/tests/url.c @@ -160,6 +160,7 @@ static const TEST_URL_CANONICALIZE TEST_CANONICALIZE[] = { {"A", 0, S_OK, "A", FALSE}, {"/uri-res/N2R?urn:sha1:B3K", URL_DONT_ESCAPE_EXTRA_INFO | URL_WININET_COMPATIBILITY /*0x82000000*/, S_OK, "/uri-res/N2R?urn:sha1:B3K", FALSE} /*LimeWire online installer calls this*/, {"http:www.winehq.org/dir/../index.html", 0, S_OK, "http:www.winehq.org/index.html"}, + {"http://localhost/test.html", URL_FILE_USE_PATHURL, S_OK, "http://localhost/test.html"} }; /* ################ */ diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c index 156871425da..958a8429f53 100644 --- a/dlls/shlwapi/url.c +++ b/dlls/shlwapi/url.c @@ -359,6 +359,7 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized, if (*wk1 != '/') {state = 6; break;} *wk2++ = *wk1++; if((dwFlags & URL_FILE_USE_PATHURL) && nByteLen >= sizeof(wszLocalhost) + && !strncmpW(wszFile, pszUrl, sizeof(wszFile)/sizeof(WCHAR)) && !memcmp(wszLocalhost, wk1, sizeof(wszLocalhost))){ wk1 += sizeof(wszLocalhost)/sizeof(WCHAR); while(*wk1 == '\\' && (dwFlags & URL_FILE_USE_PATHURL)) -- 2.11.4.GIT