X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6ee654e6bb28d20841d115f667239739e3ac42ef..55c56a6d80f0ee4a4bf2add6ba1f62c02cbfc23e:/src/common/fs_inet.cpp diff --git a/src/common/fs_inet.cpp b/src/common/fs_inet.cpp index 6c2eeb52e2..8d295d4677 100644 --- a/src/common/fs_inet.cpp +++ b/src/common/fs_inet.cpp @@ -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;