diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 70f131f45b..718db943ce 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -1249,7 +1249,8 @@ wxString wxFileName::GetTempDir() dir = wxMacFindFolderNoSeparator(short(kOnSystemDisk), kTemporaryFolderType, kCreateFolder); #endif // systems with native way } - else // we got directory from an environment variable + + if ( !dir.empty() ) { // remove any trailing path separators, we don't want to ever return // them from this function for consistency @@ -1266,7 +1267,7 @@ wxString wxFileName::GetTempDir() } // fall back to hard coded value - if ( dir.empty() ) + else { #ifdef __UNIX_LIKE__ dir = CheckIfDirExists("/tmp");