]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/fs_inet.cpp
Attempting to allow WIN16 compilation of the db/dbtable classes
[wxWidgets.git] / src / common / fs_inet.cpp
index 4a06c7c46010ae4c9d5c7d42c11f00ae0c0b64eb..8d295d4677376326b449a754f0dd0003f0f5c295 100644 (file)
@@ -82,7 +82,17 @@ bool wxInternetFSHandler::CanOpen(const wxString& location)
 
 wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location)
 {
-    wxString right = GetProtocol(location) + wxT(":") + GetRightLocation(location);
+    wxString myloc(GetRightLocation(location));
+    
+    // fix malformed url:
+    if (myloc.Left(2) != wxT("//")) 
+    {
+        if (myloc.GetChar(0) != wxT('/')) myloc = wxT("//") + myloc;
+        else myloc = wxT("/") + myloc;
+    }
+    if (myloc.Mid(2).Find(wxT('/')) == wxNOT_FOUND) myloc << wxT('/');
+
+    wxString right = GetProtocol(location) + wxT(":") + myloc;
     wxInputStream *s;
     wxString content;
     wxInetCacheNode *info;
@@ -126,7 +136,8 @@ wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxStri
         return new wxFSFile(s,
                             right,
                             info->GetMime(),
-                            GetAnchor(location));
+                            GetAnchor(location),
+                            wxDateTime::Today());
     }
     else return (wxFSFile*) NULL;
 }