]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filesys.cpp
applied patch 432814: saving BMP in 1, 4 and 8 bpp
[wxWidgets.git] / src / common / filesys.cpp
index c06e2bebc2e023a2c356ba5ef26d6abb10438451..8509d41a021bb3ccda2a40d63df1bb66a5f4b860 100644 (file)
@@ -24,7 +24,7 @@
 #include "wx/module.h"
 #include "wx/filesys.h"
 #include "wx/mimetype.h"
-
+#include "wx/filename.h"
 
 
 
@@ -155,15 +155,18 @@ bool wxLocalFSHandler::CanOpen(const wxString& location)
 
 wxFSFile* wxLocalFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location)
 {
+    // location has Unix path separators
     wxString right = GetRightLocation(location);
-    if (!wxFileExists(right))
+    wxFileName fn( right, wxPATH_UNIX );
+    
+    if (!wxFileExists( fn.GetFullPath() ))
         return (wxFSFile*) NULL;
-
-    return new wxFSFile(new wxFileInputStream(right),
+        
+    return new wxFSFile(new wxFileInputStream( fn.GetFullPath() ),
                         right,
                         GetMimeTypeFromExt(location),
                         GetAnchor(location),
-                        wxDateTime(wxFileModificationTime(right)));
+                        wxDateTime(wxFileModificationTime( fn.GetFullPath() )));
 
 }