]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/fs_inet.cpp
fixed memory leak (m_PagesHash not deleted)
[wxWidgets.git] / src / common / fs_inet.cpp
index 6c2eeb52e22ea43d8636312be6d209f48c3155ab..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;