]> git.saurik.com Git - wxWidgets.git/commitdiff
set m_error correctly (patch 1249848)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 6 Aug 2005 21:35:12 +0000 (21:35 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 6 Aug 2005 21:35:12 +0000 (21:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35138 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/sckfile.cpp

index 483f4eb7c872535cd7eeed85b042f49a90f34340..db1cab98ccc8919d5f332bd7541ccec8af0a80ab 100644 (file)
@@ -33,8 +33,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxFileProto, wxProtocol)
 IMPLEMENT_PROTOCOL(wxFileProto, wxT("file"), NULL, false)
 
 wxFileProto::wxFileProto()
-  : wxProtocol()
+           : wxProtocol()
 {
+    m_error = wxPROTO_NOERR;
 }
 
 wxFileProto::~wxFileProto()
@@ -43,13 +44,18 @@ wxFileProto::~wxFileProto()
 
 wxInputStream *wxFileProto::GetInputStream(const wxString& path)
 {
-  wxFileInputStream* retval = new wxFileInputStream(wxURI::Unescape(path));
-  if (retval->Ok()) {
-    return retval;
-  } else {
+    wxFileInputStream *retval = new wxFileInputStream(wxURI::Unescape(path));
+    if ( retval->Ok() )
+    {
+        m_error = wxPROTO_NOERR;
+
+        return retval;
+    }
+
+    m_error = wxPROTO_NOFILE;
     delete retval;
-    return 0;
-  }
+
+    return NULL;
 }
 
 #endif // wxUSE_STREAMS && wxUSE_PROTOCOL_FILE