Commit fddd703b authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

shlwapi: Change '/'->'\' only for file protocol in UrlCanonicalize.

parent ae154d44
......@@ -75,6 +75,8 @@ const TEST_URL_CANONICALIZE TEST_CANONICALIZE[] = {
{"file:///c://tests/foo%20bar", URL_FILE_USE_PATHURL, S_OK, "file://c:\\\\tests\\foo bar"},
{"file:///c:\\tests\\foo bar", 0, S_OK, "file:///c:/tests/foo bar"},
{"file:///c:\\tests\\foo bar", URL_DONT_SIMPLIFY, S_OK, "file:///c:/tests/foo bar"},
{"http://www.winehq.org/site/about", URL_FILE_USE_PATHURL, S_OK, "http://www.winehq.org/site/about"},
{"file_://www.winehq.org/site/about", URL_FILE_USE_PATHURL, S_OK, "file_://www.winehq.org/site/about"},
};
typedef struct _TEST_URL_ESCAPE {
......
......@@ -330,7 +330,9 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
LPWSTR lpszUrlCpy, wk1, wk2, mp, mp2, root;
INT nByteLen, state;
DWORD nLen, nWkLen;
WCHAR slash = dwFlags & URL_FILE_USE_PATHURL ? '\\' : '/';
WCHAR slash = '/';
static const WCHAR wszFile[] = {'f','i','l','e',':'};
TRACE("(%s %p %p 0x%08lx)\n", debugstr_w(pszUrl), pszCanonicalized,
pcchCanonicalized, dwFlags);
......@@ -341,6 +343,10 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
nByteLen = (lstrlenW(pszUrl) + 1) * sizeof(WCHAR); /* length in bytes */
lpszUrlCpy = HeapAlloc(GetProcessHeap(), 0, nByteLen);
if((dwFlags & URL_FILE_USE_PATHURL) && nByteLen >= sizeof(wszFile)
&& !memcmp(wszFile, pszUrl, sizeof(wszFile)))
slash = '\\';
/*
* state =
* 0 initial 1,3
......
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