Commit 7c42bfe1 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

shlwapi: UrlIs()'s check for the 'file:' protocol is case insensitive.

parent 7fcf7e83
......@@ -450,7 +450,8 @@ static const struct {
{ "file://e:/b/c", FALSE, TRUE },
{ "http:partial", FALSE, FALSE },
{ "mailto://www.winehq.org/test.html", TRUE, FALSE },
{ "file:partial", FALSE, TRUE }
{ "file:partial", FALSE, TRUE },
{ "File:partial", FALSE, TRUE },
};
/* ########################### */
......
......@@ -1864,7 +1864,8 @@ BOOL WINAPI UrlIsA(LPCSTR pszUrl, URLIS Urlis)
return FALSE;
case URLIS_FILEURL:
return !StrCmpNA("file:", pszUrl, 5);
return (CompareStringA(LOCALE_INVARIANT, NORM_IGNORECASE, pszUrl, 5,
"file:", 5) == CSTR_EQUAL);
case URLIS_DIRECTORY:
last = pszUrl + strlen(pszUrl) - 1;
......@@ -1889,7 +1890,7 @@ BOOL WINAPI UrlIsA(LPCSTR pszUrl, URLIS Urlis)
*/
BOOL WINAPI UrlIsW(LPCWSTR pszUrl, URLIS Urlis)
{
static const WCHAR stemp[] = { 'f','i','l','e',':',0 };
static const WCHAR file_colon[] = { 'f','i','l','e',':',0 };
PARSEDURLW base;
DWORD res1;
LPCWSTR last;
......@@ -1917,7 +1918,8 @@ BOOL WINAPI UrlIsW(LPCWSTR pszUrl, URLIS Urlis)
return FALSE;
case URLIS_FILEURL:
return !strncmpW(stemp, pszUrl, 5);
return (CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pszUrl, 5,
file_colon, 5) == CSTR_EQUAL);
case URLIS_DIRECTORY:
last = pszUrl + strlenW(pszUrl) - 1;
......
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