aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2011-07-10 19:04:49 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2011-07-10 19:04:49 +0200
commit160f12687e3eec7ebc12869504b614344370b771 (patch)
tree9871380257aab3de095d21ab8af27570c94e8eb1 /src/utils.c
parent34caa4a426b3a3eabd08e9fe5c7bc088d2285393 (diff)
parent34f094312fc2e9dce7621449e07f25c748039f97 (diff)
downloadcalcurse-160f12687e3eec7ebc12869504b614344370b771.tar.gz
calcurse-160f12687e3eec7ebc12869504b614344370b771.zip
Merge branch 'maint'
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c15
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.