diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-07-10 19:04:49 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-07-10 19:04:49 +0200 |
commit | 160f12687e3eec7ebc12869504b614344370b771 (patch) | |
tree | 9871380257aab3de095d21ab8af27570c94e8eb1 /src/utils.c | |
parent | 34caa4a426b3a3eabd08e9fe5c7bc088d2285393 (diff) | |
parent | 34f094312fc2e9dce7621449e07f25c748039f97 (diff) | |
download | calcurse-160f12687e3eec7ebc12869504b614344370b771.zip |
Merge branch 'maint'
Diffstat (limited to 'src/utils.c')
-rw-r--r-- | src/utils.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c index a39b7df..949b1b7 100644 --- a/src/utils.c +++ b/src/utils.c @@ -545,6 +545,21 @@ print_bool_option_incolor (WINDOW *win, unsigned option, int pos_y, int pos_x) wins_doupdate (); } + +/* + * Get the name of the default directory for temporary files. + */ +const char * +get_tempdir (void) +{ + if (getenv ("TMPDIR")) + return getenv ("TMPDIR"); + else if (P_tmpdir) + return P_tmpdir; + else + return "/tmp"; +} + /* * Create a new unique file, and return a newly allocated string which contains * the random part of the file name. |