X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b5f62a0b2db198609b45dec622a018dae37008e..64e9f56b807228891c5839a01d26db4e6e9e9139:/src/common/filesys.cpp diff --git a/src/common/filesys.cpp b/src/common/filesys.cpp index 8e26b5d904..d335bf7e7a 100644 --- a/src/common/filesys.cpp +++ b/src/common/filesys.cpp @@ -431,6 +431,7 @@ wxString wxFileSystem::URLToNativePath( const wxString& url ) path = path.Mid(7) ; } +#ifndef __UNIX__ // file urls either start with a forward slash (local harddisk), // otherwise they have a servername/sharename notation, // which only exists on msw and corresponds to a unc @@ -438,14 +439,14 @@ wxString wxFileSystem::URLToNativePath( const wxString& url ) { path = path.Mid(1) ; } -#ifdef __WXMSW__ else if ( (url.Find(wxT("file://")) == 0) && (path.Find(wxT('/')) != wxNOT_FOUND) && (path.Length() > 1) && (path[1u] != wxT(':')) ) { - path = wxT("\\\\") + path ; + path = wxT("//") + path ; } #endif + path.Replace(g_unixPathString, g_nativePathString) ; return path ; @@ -455,6 +456,7 @@ wxString wxFileSystem::URLToNativePath( const wxString& url ) wxString wxFileSystem::NativePathToURL( const wxString& path ) { wxString url = path ; + #ifdef __WXMSW__ // unc notation if ( url.Find(wxT("\\\\")) == 0 ) @@ -466,6 +468,7 @@ wxString wxFileSystem::NativePathToURL( const wxString& path ) { url = wxT("/") + url ; } + url.Replace(g_nativePathString, g_unixPathString) ; url = wxT("file://") + url ; return url ;