mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-06 23:02:42 +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:
parent
07090e691b
commit
0f597ae98e
@ -1584,9 +1584,15 @@ bool AudacityApp::IsTempDirectoryNameOK( const wxString & Name ){
|
|||||||
// use Long Path to expand out any abbreviated long substrings.
|
// use Long Path to expand out any abbreviated long substrings.
|
||||||
wxString BadPath = tmpFile.GetLongPath();
|
wxString BadPath = tmpFile.GetLongPath();
|
||||||
::wxRemoveFile(tmpFile.GetFullPath());
|
::wxRemoveFile(tmpFile.GetFullPath());
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
BadPath = BadPath.BeforeLast( '/' ) + "/";
|
||||||
|
wxFileName cmpFile( Name );
|
||||||
|
wxString NameCanonical = cmpFile.GetLongPath( ) + "/";
|
||||||
|
#else
|
||||||
BadPath = BadPath.BeforeLast( '\\' ) + "\\";
|
BadPath = BadPath.BeforeLast( '\\' ) + "\\";
|
||||||
wxFileName cmpFile( Name );
|
wxFileName cmpFile( Name );
|
||||||
wxString NameCanonical = cmpFile.GetLongPath( ) + "\\";
|
wxString NameCanonical = cmpFile.GetLongPath( ) + "\\";
|
||||||
|
#endif
|
||||||
return !(NameCanonical.StartsWith( BadPath ));
|
return !(NameCanonical.StartsWith( BadPath ));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user