GNOME Bugzilla – Bug 705075
Simplify g_get_tmp_dir()
Last modified: 2013-08-04 15:29:54 UTC
The docs say "This is found from inspecting the environment variables TMPDIR, TMP, and TEMP in that order." I hate this crap. It's a mess, and we're only contributing to it. POSIX is quite clear that the only variable that we should be looking at here is TMPDIR, so let's just do that.
Oh... of course, on Windows, it's supposed to be %TEMP%, but we should limit this to Windows.
Created attachment 250371 [details] [review] g_get_tmp_dir(): Clean up envars On UNIX, we should only ever be looking at TMPDIR. On Windows, we should only ever look at TEMP. Also, clean up the documentation to better describe what is actually happening. The previous docs may have left someone confused about why this function returns "/var/tmp" on Solaris, even with no TMPDIR set.
There may be an issue here with cygwin, if they would prefer we use TMPDIR. I always forget G_OS_WIN32 vs. G_PLATFORM_WIN32....
Comment on attachment 250371 [details] [review] g_get_tmp_dir(): Clean up envars The unix bits look fine. No clue if the windows part is right or not.
Looks good to me too
Talked to Dieter and discovered that G_OS_UNIX is defined on cygwin, so this will be fine.
Attachment 250371 [details] pushed as c235240 - g_get_tmp_dir(): Clean up envars