1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-25 08:58:06 +02:00

Update defaultTempDir path in AudacityApp.cpp

- Add a check against the `TMPDIR` environment variable and use it when it is defined to set the `defaultTempDir`.
This commit is contained in:
Daniel Llewellyn 2017-11-07 16:07:04 +00:00
parent e6d069787b
commit 063088c9f1

View File

@ -1283,8 +1283,15 @@ bool AudacityApp::OnInit()
* The "share" and "share/doc" directories in their install path */
wxString home = wxGetHomeDir();
/* On Unix systems, the default temp dir is in /var/tmp. */
defaultTempDir.Printf(wxT("/var/tmp/audacity-%s"), wxGetUserId());
wxString envTempDir = wxGetenv(wxT("TMPDIR"));
if (envTempDir != wxT("")) {
/* On Unix systems, the environment variable TMPDIR may point to
an unusual path when /tmp and /var/tmp are not desirable. */
defaultTempDir.Printf(wxT("%s/audacity-%s"), envTempDir, wxGetUserId());
} else {
/* On Unix systems, the default temp dir is in /var/tmp. */
defaultTempDir.Printf(wxT("/var/tmp/audacity-%s"), wxGetUserId());
}
// DA: Path env variable.
#ifndef EXPERIMENTAL_DA