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

Alexandre Julliard julliard at winehq.org
Thu Apr 24 06:23:46 CDT 2008


Module: wine
Branch: master
Commit: 8dddd89500f15bcd192f6c38c913b9d66e01ecba
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8dddd89500f15bcd192f6c38c913b9d66e01ecba

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Apr 23 17:09:05 2008 +0200

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

---

 dlls/urlmon/file.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dlls/urlmon/file.c b/dlls/urlmon/file.c
index 91aca2c..b3691b0 100644
--- a/dlls/urlmon/file.c
+++ b/dlls/urlmon/file.c
@@ -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);
 




More information about the wine-cvs mailing list