diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-02-20 23:07:37 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-02-20 23:07:37 +0300 |
commit | 2e299df561c22fec827282d7de8bd5b779ece0db (patch) | |
tree | 52c64503464d4024f08ff9490b35eb3b134fd8c0 /source/blender/blenlib/intern/util.c | |
parent | 4c0b33ef80efda5628883d6ca12e855dfe95d9e9 (diff) |
Only use $TEMP for win32, for other os's use $TMP or $TMPDIR
Diffstat (limited to 'source/blender/blenlib/intern/util.c')
-rw-r--r-- | source/blender/blenlib/intern/util.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index f849b022e6e..c3917178347 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -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') { |