From c82e1fa4304c990c54bf876339a1761e9ef570dd Mon Sep 17 00:00:00 2001 From: Meep-Eep Date: Sat, 28 Jul 2007 16:41:56 +0000 Subject: [PATCH] Add /var/tmp as possible location for temporary files. Don't try /tmp and /var/tmp at all on MS Windows (Cygwin excepted) git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2824 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 2 ++ sc2/src/sc2code/libs/file/temp.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/sc2/ChangeLog b/sc2/ChangeLog index ceb8e22c2..0dca6d210 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,6 @@ Changes towards version 0.7: +- Add /var/tmp as possible location for temporary files. Don't try + /tmp and /var/tmp at all on MS Windows (Cygwin excepted) - SvdB - Added fullscreen/windowed toggle key F11 - Mika - Allow building without ogg vorbis support (bug #852) - SvdB - Reworked SuperMelee fleet loading (fixes bug #823) - SvdB diff --git a/sc2/src/sc2code/libs/file/temp.c b/sc2/src/sc2code/libs/file/temp.c index df34eb85e..073995390 100644 --- a/sc2/src/sc2code/libs/file/temp.c +++ b/sc2/src/sc2code/libs/file/temp.c @@ -97,7 +97,10 @@ getTempDir (char *buf, size_t buflen) { if (tryTempDir (buf, buflen, getenv("TMP")) && tryTempDir (buf, buflen, getenv("TEMP")) && +#if !defined(WIN32) || defined (__CYGWIN__) tryTempDir (buf, buflen, "/tmp/") && + tryTempDir (buf, buflen, "/var/tmp/") && +#endif tryTempDir (buf, buflen, getcwd (cwd, sizeof cwd))) { log_add (log_Fatal, "Fatal Error: Cannot find a suitable location "