From: David Lawrence Ramsey Date: Thu, 6 Apr 2006 21:41:48 +0000 (+0000) Subject: in safe_tempfile(), don't ignore $TMPDIR if it's set but blank, for X-Git-Tag: v1.3.12~322 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=ac8dfca5101e73e5093ff75c16d89f75b2068514;p=nano.git in safe_tempfile(), don't ignore $TMPDIR if it's set but blank, for consistency git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3356 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index dac25e88..ac497b0b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,9 @@ CVS code - - Open all files in binary mode for consistency and robustness. Changes to load_history() and do_rcfile(). (DLR) - files.c: + safe_tempfile() + - Don't ignore $TMPDIR if it's set but blank, for consistency. + (DLR) write_file() - Don't free backupname before displaying it in a statusbar error message. (DLR, found by Bill Marcum) diff --git a/src/files.c b/src/files.c index 00168d5f..04b4b42b 100644 --- a/src/files.c +++ b/src/files.c @@ -1061,11 +1061,11 @@ char *safe_tempfile(FILE **f) assert(f != NULL); - /* If $TMPDIR is set and non-empty, set tempdir to it, run it - * through get_full_path(), and save the result in full_tempdir. - * Otherwise, leave full_tempdir set to NULL. */ + /* If $TMPDIR is set, set tempdir to it, run it through + * get_full_path(), and save the result in full_tempdir. Otherwise, + * leave full_tempdir set to NULL. */ tmpdir_env = getenv("TMPDIR"); - if (tmpdir_env != NULL && tmpdir_env[0] != '\0') + if (tmpdir_env != NULL) full_tempdir = check_writable_directory(tmpdir_env); /* If $TMPDIR is unset, empty, or not a writable directory, and