From b5eec8131507773eb6688b84e90b072f2ca71812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Hentschel?= Date: Tue, 23 Sep 2014 22:23:35 +0200 Subject: [PATCH] winemenubuilder: Respect TMPDIR environment variable. --- programs/winemenubuilder/winemenubuilder.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c index fba3664b646..5d3bb27731e 100644 --- a/programs/winemenubuilder/winemenubuilder.c +++ b/programs/winemenubuilder/winemenubuilder.c @@ -1141,6 +1141,7 @@ static HRESULT platform_write_icon(IStream *icoStream, int exeIndex, LPCWSTR ico } best[ICNS_SLOTS]; int indexes[ICNS_SLOTS]; int i; + const char* tmpdir; char *icnsPath = NULL; LARGE_INTEGER zero; HRESULT hr; @@ -1210,7 +1211,8 @@ static HRESULT platform_write_icon(IStream *icoStream, int exeIndex, LPCWSTR ico hr = E_OUTOFMEMORY; goto end; } - icnsPath = heap_printf("/tmp/%s.icns", *nativeIdentifier); + if (!(tmpdir = getenv("TMPDIR"))) tmpdir = "/tmp"; + icnsPath = heap_printf("%s/%s.icns", tmpdir, *nativeIdentifier); if (icnsPath == NULL) { hr = E_OUTOFMEMORY;