Commit 8dddd895 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Ignore query and hash part in file protocol URL.

parent 9ee7e42d
......@@ -99,8 +99,7 @@ static HRESULT WINAPI FileProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
DWORD grfBINDF = 0;
LARGE_INTEGER size;
DWORD len;
LPWSTR url, mime = NULL;
LPCWSTR file_name;
LPWSTR url, mime = NULL, file_name;
WCHAR null_char = 0;
BOOL first_call = FALSE;
HRESULT hres;
......@@ -136,6 +135,8 @@ static HRESULT WINAPI FileProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_DIRECTBIND, NULL);
if(!This->file) {
WCHAR *ptr;
first_call = TRUE;
IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_SENDINGREQUEST, &null_char);
......@@ -146,6 +147,13 @@ static HRESULT WINAPI FileProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
if(*file_name == '/')
file_name++;
for(ptr = file_name; *ptr; ptr++) {
if(*ptr == '?' || *ptr == '#') {
*ptr = 0;
break;
}
}
This->file = CreateFileW(file_name, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
......
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