From d03bf15a8ddd548e0a49fe458629e303d6225c98 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 26 Oct 2010 17:26:28 +0200 Subject: [PATCH] Fixed: getTemporaryDirectory() under Linux --- code/nel/src/misc/path.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/code/nel/src/misc/path.cpp b/code/nel/src/misc/path.cpp index 8fc8435d7..dfc8e6381 100644 --- a/code/nel/src/misc/path.cpp +++ b/code/nel/src/misc/path.cpp @@ -1727,10 +1727,16 @@ std::string CFileContainer::getTemporaryDirectory() static std::string path; if (path.empty()) { - std::string tempDir = getenv("TEMP"); + const char *temp = getenv("TEMP"); + const char *tmp = getenv("TMP"); - if (tempDir.empty()) - tempDir = getenv("TMP"); + std::string tempDir; + + if (temp) + tempDir = temp; + + if (tempDir.empty() && tmp) + tempDir = tmp; #ifdef NL_OS_UNIX if (tempDir.empty())