dbus/dbus-sysdeps-win.c: use GetTempPath, not getenv, in _dbus_get_tmpdir (cherry picked from commit c2366c5410149e896cb56c3d17bb995308e18292)

This commit is contained in:
Tor Lillqvist 2009-04-22 13:27:44 +02:00 committed by Ralf Habacker
parent 3b8aa7dc7c
commit 9ea9cd1bdd

View file

@ -2388,17 +2388,14 @@ const char*
_dbus_get_tmpdir(void)
{
static const char* tmpdir = NULL;
static char buf[1000];
if (tmpdir == NULL)
{
if (tmpdir == NULL)
tmpdir = getenv("TMP");
if (tmpdir == NULL)
tmpdir = getenv("TEMP");
if (tmpdir == NULL)
tmpdir = getenv("TMPDIR");
if (tmpdir == NULL)
tmpdir = "C:\\Temp";
if (!GetTempPath (sizeof (buf), buf))
strcpy (buf, "\\");
tmpdir = buf;
}
_dbus_assert(tmpdir != NULL);