Module: wine Branch: master Commit: 7c42bfe107cb79418e6540825eb9176b7d78021c URL: http://source.winehq.org/git/wine.git/?a=commit;h=7c42bfe107cb79418e6540825e...
Author: Francois Gouget fgouget@codeweavers.com Date: Wed Sep 26 04:20:00 2012 +0200
shlwapi: UrlIs()'s check for the 'file:' protocol is case insensitive.
---
dlls/shlwapi/tests/url.c | 3 ++- dlls/shlwapi/url.c | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c index b24a277..6cef9d6 100644 --- a/dlls/shlwapi/tests/url.c +++ b/dlls/shlwapi/tests/url.c @@ -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 }, };
/* ########################### */ diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c index f483db3..70a0b87 100644 --- a/dlls/shlwapi/url.c +++ b/dlls/shlwapi/url.c @@ -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;