X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0fba0ec77b2e319b56039a6fb09e15e251577ce6..ce29e4fbe5d8f0c0e6972da064446204e59e9905:/src/common/sckfile.cpp diff --git a/src/common/sckfile.cpp b/src/common/sckfile.cpp index c9f723a145..483f4eb7c8 100644 --- a/src/common/sckfile.cpp +++ b/src/common/sckfile.cpp @@ -30,7 +30,7 @@ #include "wx/protocol/file.h" IMPLEMENT_DYNAMIC_CLASS(wxFileProto, wxProtocol) -IMPLEMENT_PROTOCOL(wxFileProto, wxT("file"), NULL, FALSE) +IMPLEMENT_PROTOCOL(wxFileProto, wxT("file"), NULL, false) wxFileProto::wxFileProto() : wxProtocol() @@ -43,7 +43,13 @@ wxFileProto::~wxFileProto() wxInputStream *wxFileProto::GetInputStream(const wxString& path) { - return new wxFileInputStream(wxURL::ConvertFromURI(path)); + wxFileInputStream* retval = new wxFileInputStream(wxURI::Unescape(path)); + if (retval->Ok()) { + return retval; + } else { + delete retval; + return 0; + } } #endif // wxUSE_STREAMS && wxUSE_PROTOCOL_FILE