[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13787] trunk/blender/source/blender/ blenlib/intern/util.c: Only use $TEMP for win32, for other os' s use $TMP or $TMPDIR
Campbell Barton
ideasman42 at gmail.com
Wed Feb 20 21:07:37 CET 2008
Revision: 13787
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13787
Author: campbellbarton
Date: 2008-02-20 21:07:37 +0100 (Wed, 20 Feb 2008)
Log Message:
-----------
Only use $TEMP for win32, for other os's use $TMP or $TMPDIR
Modified Paths:
--------------
trunk/blender/source/blender/blenlib/intern/util.c
Modified: trunk/blender/source/blender/blenlib/intern/util.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/util.c 2008-02-20 18:56:07 UTC (rev 13786)
+++ trunk/blender/source/blender/blenlib/intern/util.c 2008-02-20 20:07:37 UTC (rev 13787)
@@ -1616,10 +1616,23 @@
}
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') {
More information about the Bf-blender-cvs
mailing list