X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/55d99c7a77789ff4904bf96eddca3715eb5af9b9..e508567a95c7858f7bbf21d37c189fdd6f3eac2e:/src/common/sckfile.cpp diff --git a/src/common/sckfile.cpp b/src/common/sckfile.cpp index a36b7756ce..483f4eb7c8 100644 --- a/src/common/sckfile.cpp +++ b/src/common/sckfile.cpp @@ -8,7 +8,7 @@ // Copyright: (c) 1997, 1998 Guilhem Lavaux // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "sckfile.h" #endif @@ -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(path); + wxFileInputStream* retval = new wxFileInputStream(wxURI::Unescape(path)); + if (retval->Ok()) { + return retval; + } else { + delete retval; + return 0; + } } #endif // wxUSE_STREAMS && wxUSE_PROTOCOL_FILE