X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ef0e85f3f19bb66450d77b98606a315b3f1897a2..ed7c11abc829a8f7becc92ee438866e36f2216fe:/src/common/sckfile.cpp?ds=sidebyside diff --git a/src/common/sckfile.cpp b/src/common/sckfile.cpp index 11134b8373..a5c148b90c 100644 --- a/src/common/sckfile.cpp +++ b/src/common/sckfile.cpp @@ -6,9 +6,9 @@ // Created: 20/07/97 // RCS-ID: $Id$ // Copyright: (c) 1997, 1998 Guilhem Lavaux -// Licence: wxWindows license +// 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(wxURL::ConvertFromURI(path)); + if (retval->Ok()) { + return retval; + } else { + delete retval; + return 0; + } } #endif // wxUSE_STREAMS && wxUSE_PROTOCOL_FILE