From 0f597ae98ec377b056ea1ef71666249334ae9031 Mon Sep 17 00:00:00 2001 From: James Crook Date: Wed, 6 Jul 2016 16:17:40 +0100 Subject: [PATCH] Bug 1220: Backslashes wrong for Mac On Mac the path separator is different. so conditional code to handle that. --- src/AudacityApp.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp index 7f3a3331a..6588ae6d0 100644 --- a/src/AudacityApp.cpp +++ b/src/AudacityApp.cpp @@ -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 )); }