commit 98a8c06394bb18acfd2cd15e11166b59dceff94a
parent 12f27299f19543f95191e7a15d7eb95df33e70a1
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Sun, 7 Feb 2016 13:08:27 +0000
Eliding an unneeded 'if'.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5617 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -3,6 +3,7 @@
when they have the default cursor position (line 1, column 1).
* src/files.c (write_file): Avoid a pointless lstat() when not writing
to a temp file, and in the bargain elide two variables.
+ * src/files.c (write_file): Elide an unneeded 'if'.
2016-02-06 Benno Schulenberg <bensberg@justemail.net>
* src/files.c (write_file): Remove the --nofollow option that hasn't
diff --git a/src/files.c b/src/files.c
@@ -1765,7 +1765,7 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
/* The status fields filled in by stat(). */
char *realname;
/* name after tilde expansion. */
- FILE *f = NULL;
+ FILE *f = f_open;
/* The actual file, realname, we are writing to. */
char *tempname = NULL;
/* The name of the temporary file we write to on prepend. */
@@ -1775,9 +1775,6 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
if (*name == '\0')
return -1;
- if (f_open != NULL)
- f = f_open;
-
if (!tmp)
titlebar(NULL);