urlmon: URL with two slashes is valid.

This commit is contained in:
Jacek Caban 2005-12-26 12:59:31 +01:00 committed by Alexandre Julliard
parent 0334ba93ef
commit 7b4d59c5a0
2 changed files with 17 additions and 3 deletions

View File

@ -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);

View File

@ -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;