From: Tor Lillqvist Date: Wed, 22 Apr 2009 11:27:44 +0000 (+0200) Subject: dbus/dbus-sysdeps-win.c: use GetTempPath, not getenv, in _dbus_get_tmpdir (cherry... X-Git-Tag: dbus-1.3.1~204 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ea9cd1bddef265fc2ff765449ababb14e449876;p=thirdparty%2Fdbus.git dbus/dbus-sysdeps-win.c: use GetTempPath, not getenv, in _dbus_get_tmpdir (cherry picked from commit c2366c5410149e896cb56c3d17bb995308e18292) --- diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index 9a29a39f1..2aec55413 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -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);