Commit 7b4d59c5 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: URL with two slashes is valid.

parent 0334ba93
......@@ -145,8 +145,10 @@ static HRESULT WINAPI FileProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_SENDINGREQUEST, &null_char);
file_name = url+sizeof(wszFile)/sizeof(WCHAR);
if(file_name[0] == '/' && file_name[1] == '/' && file_name[2] == '/')
file_name += 3;
if(file_name[0] == '/' && file_name[1] == '/')
file_name += 2;
if(*file_name == '/')
file_name++;
This->file = CreateFileW(file_name, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
......
......@@ -452,7 +452,8 @@ static void test_file_protocol(void) {
HANDLE file;
static const WCHAR wszFile[] = {'f','i','l','e',':',0};
static const WCHAR wszFile2[] = {'f','i','l','e',':','/','/','/',0};
static const WCHAR wszFile2[] = {'f','i','l','e',':','/','/',0};
static const WCHAR wszFile3[] = {'f','i','l','e',':','/','/','/',0};
static const char html_doc[] = "<HTML></HTML>";
file = CreateFileW(wszIndexHtml, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
......@@ -488,7 +489,18 @@ static void test_file_protocol(void) {
memcpy(buf+len, wszIndexHtml, sizeof(wszIndexHtml));
file_name = buf + sizeof(wszFile2)/sizeof(WCHAR)-1;
bindf = 0;
test_file_protocol_url(buf);
bindf = BINDF_FROMURLMON;
test_file_protocol_url(buf);
memcpy(buf, wszFile3, sizeof(wszFile3));
len = sizeof(wszFile3)/sizeof(WCHAR)-1;
len += GetCurrentDirectoryW(sizeof(buf)/sizeof(WCHAR)-len, buf+len);
buf[len++] = '\\';
memcpy(buf+len, wszIndexHtml, sizeof(wszIndexHtml));
file_name = buf + sizeof(wszFile3)/sizeof(WCHAR)-1;
bindf = 0;
test_file_protocol_url(buf);
bindf = BINDF_FROMURLMON;
......
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