(mc_tmpdir): use $MC_TMPDIR if set.

This commit is contained in:
Andrew Borodin 2021-02-13 16:24:41 +03:00
parent 7b5b56104b
commit faa195ae59
1 changed files with 6 additions and 2 deletions

View File

@ -818,9 +818,13 @@ mc_tmpdir (void)
st.st_uid == getuid () && (st.st_mode & 0777) == 0700)
return tmpdir;
sys_tmp = getenv ("TMPDIR");
sys_tmp = getenv ("MC_TMPDIR");
if (sys_tmp == NULL || !IS_PATH_SEP (sys_tmp[0]))
sys_tmp = TMPDIR_DEFAULT;
{
sys_tmp = getenv ("TMPDIR");
if (sys_tmp == NULL || !IS_PATH_SEP (sys_tmp[0]))
sys_tmp = TMPDIR_DEFAULT;
}
pwd = getpwuid (getuid ());
if (pwd != NULL)