mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-01-21 01:20:21 +01:00
dbus/dbus-sysdeps-win.c: use GetTempPath, not getenv, in _dbus_get_tmpdir (cherry picked from commit c2366c5410149e896cb56c3d17bb995308e18292)
This commit is contained in:
parent
3b8aa7dc7c
commit
9ea9cd1bdd
1 changed files with 5 additions and 8 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue