Fixed: getTemporaryDirectory() under Linux

This commit is contained in:
kervala 2010-10-26 17:26:28 +02:00
parent ad5a89cc16
commit d03bf15a8d

View file

@ -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())