1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-31 16:09:28 +02:00

Merge pull request #211 from diddledan/patch-1

Use TMPDIR environment variable, if present.
This commit is contained in:
James Crook 2018-05-31 17:39:59 +01:00 committed by GitHub
commit 965a74cd9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1291,8 +1291,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