]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/sckfile.cpp
added wxUmaskChanger class and wxCHANGE_UMASK macro and use them instead of duplicati...
[wxWidgets.git] / src / common / sckfile.cpp
index 5dbc6a0c12e0f711fc3ba8430e0dd263976b0243..a5c148b90c39a40f9d78ebc4d9ea1f908552b92f 100644 (file)
@@ -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