Only use $TEMP for win32, for other os's use $TMP or $TMPDIR

This commit is contained in:
2008-02-20 20:07:37 +00:00
parent 4c0b33ef80
commit 2e299df561

View File

@@ -1616,10 +1616,23 @@ void BLI_where_is_temp(char *fullname, int usertemp)
}
if (fullname[0] == '\0') {
char *tmp = getenv("TEMP");
#ifdef WIN32
char *tmp = getenv("TEMP"); /* Windows */
if (tmp && BLI_exists(tmp)) {
strcpy(fullname, tmp);
}
#else
char *tmp = getenv("TMPDIR"); /* Other OS's - Try TMP and TMPDIR */
if (tmp && BLI_exists(tmp)) {
strcpy(fullname, tmp);
}
if (fullname[0] == '\0') {
tmp = getenv("TMP");
if (tmp && BLI_exists(tmp)) {
strcpy(fullname, tmp);
}
}
#endif
}
if (fullname[0] == '\0') {