1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-06 14:52:34 +02:00

Bug 1220: Backslashes wrong for Mac

On Mac the path separator is different.  so conditional code to handle that.
This commit is contained in:
James Crook 2016-07-06 16:17:40 +01:00
parent 07090e691b
commit 0f597ae98e

View File

@ -1584,9 +1584,15 @@ bool AudacityApp::IsTempDirectoryNameOK( const wxString & Name ){
// use Long Path to expand out any abbreviated long substrings.
wxString BadPath = tmpFile.GetLongPath();
::wxRemoveFile(tmpFile.GetFullPath());
#ifdef __WXMAC__
BadPath = BadPath.BeforeLast( '/' ) + "/";
wxFileName cmpFile( Name );
wxString NameCanonical = cmpFile.GetLongPath( ) + "/";
#else
BadPath = BadPath.BeforeLast( '\\' ) + "\\";
wxFileName cmpFile( Name );
wxString NameCanonical = cmpFile.GetLongPath( ) + "\\";
#endif
return !(NameCanonical.StartsWith( BadPath ));
}