Module: wine Branch: master Commit: a39761a68e9493071252832dd8799abf52b68269 URL: http://source.winehq.org/git/wine.git/?a=commit;h=a39761a68e9493071252832dd8...
Author: Piotr Caban piotr@codeweavers.com Date: Sun Oct 30 17:45:27 2011 +0100
urlmon: Improve disk detection in MapUrlToZone.
---
dlls/urlmon/sec_mgr.c | 6 +++--- dlls/urlmon/tests/sec_mgr.c | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/urlmon/sec_mgr.c b/dlls/urlmon/sec_mgr.c index b7e1c36..8e55712 100644 --- a/dlls/urlmon/sec_mgr.c +++ b/dlls/urlmon/sec_mgr.c @@ -543,11 +543,11 @@ static HRESULT map_security_uri_to_zone(IUri *uri, DWORD *zone) else path_start = path;
- if(((ptr = strchrW(path_start, '\')) || (ptr = strchrW(path_start, '/'))) && ptr-path_start < sizeof(root)/sizeof(WCHAR)) { + if((ptr = strchrW(path_start, ':')) && ptr-path_start+1 < sizeof(root)/sizeof(WCHAR)) { UINT type;
- memcpy(root, path_start, (ptr-path_start)*sizeof(WCHAR)); - root[ptr-path_start] = 0; + memcpy(root, path_start, (ptr-path_start+1)*sizeof(WCHAR)); + root[ptr-path_start+1] = 0;
type = GetDriveTypeW(root);
diff --git a/dlls/urlmon/tests/sec_mgr.c b/dlls/urlmon/tests/sec_mgr.c index 1311ea9..2f33f02 100644 --- a/dlls/urlmon/tests/sec_mgr.c +++ b/dlls/urlmon/tests/sec_mgr.c @@ -103,6 +103,8 @@ static const WCHAR url12[] = {'f','i','l','e',':','/','/','/','c',':','/','I','n static const WCHAR url13[] = {'h','t','t','p',':','g','o','o','g','l','e','.','c','o','m',0}; static const WCHAR url14[] = {'z','i','p',':','t','e','s','t','i','n','g','.','c','o','m','/','t','e','s','t','i','n','g',0}; static const WCHAR url15[] = {'h','t','t','p',':','/','/','g','o','o','g','l','e','.','c','o','m','.','u','k',0}; +static const WCHAR url16[] = {'f','i','l','e',':','/','/','/','c',':',0}; +static const WCHAR url17[] = {'f','i','l','e',':','/','/','/','c',':','c','\',0};
static const WCHAR url4e[] = {'f','i','l','e',':','s','o','m','e',' ','f','i','l','e', '.','j','p','g',0}; @@ -157,7 +159,9 @@ static struct secmgr_test { {url6, 3, S_OK, sizeof(secid6), secid6, S_OK}, {url7, 3, S_OK, sizeof(secid7), secid7, S_OK}, {url11,0, S_OK, sizeof(secid1), secid1, S_OK}, - {url12,0, S_OK, sizeof(secid1), secid1, S_OK} + {url12,0, S_OK, sizeof(secid1), secid1, S_OK}, + {url16,0, S_OK, sizeof(secid1), secid1, S_OK}, + {url17,0, S_OK, sizeof(secid1), secid1, S_OK} };
static int strcmp_w(const WCHAR *str1, const WCHAR *str2)