X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f63fb56d5ee3bf21205d1c2038099caf63c19910..24bcaec36746abeeb9e2023d03e3ab4289006fc3:/src/common/filename.cpp diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 7dc9c0a196..99832bf995 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -359,7 +359,7 @@ void wxFileName::Assign(const wxString& fullpathOrig, _T("the path shouldn't contain file name nor extension") ); #else // !__WXDEBUG__ - SplitPath(fullname, NULL /* no path */, &name, &ext, format); + SplitPath(fullname, NULL /* no path */, &name, &ext, format); SplitPath(fullpath, &volume, &path, NULL, NULL, format); #endif // __WXDEBUG__/!__WXDEBUG__ @@ -732,7 +732,7 @@ bool wxFileName::Rmdir( const wxString &dir ) // path normalization // ---------------------------------------------------------------------------- -bool wxFileName::Normalize(wxPathNormalize flags, +bool wxFileName::Normalize(int flags, const wxString& cwd, wxPathFormat format) { @@ -1043,8 +1043,10 @@ wxString wxFileName::GetFullName() const return fullname; } -wxString wxFileName::GetPath( bool add_separator, wxPathFormat format ) const +wxString wxFileName::GetPath( bool, wxPathFormat format ) const { + // Should add_seperator parameter be used? + format = GetFormat( format ); wxString fullpath; @@ -1484,7 +1486,10 @@ void wxFileName::SplitPath(const wxString& fullpathWithVolume, // the path equal to something like '/', not empty, for the files // immediately under root directory size_t len = posLastSlash; - if ( !len ) + + // this rule does not apply to mac since we do not start with colons (sep) + // except for relative paths + if ( !len && format != wxPATH_MAC) len++; *pstrPath = fullpath.Left(len); @@ -1773,4 +1778,3 @@ void wxFileName::MacRegisterDefaultTypeAndCreator( const wxString& ext , wxUint3 gMacDefaultExtensions.Add( rec ) ; } #endif -