Commit 125b2f0b authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

in write_file(), simplify the routine for closing the file just before

we indicate success on the statusbar


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3362 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent adfecd24
Showing with 4 additions and 5 deletions
+4 -5
...@@ -26,6 +26,8 @@ CVS code - ...@@ -26,6 +26,8 @@ CVS code -
suggested by Jordi) suggested by Jordi)
- Clarify the error message when writing a temporary file for - Clarify the error message when writing a temporary file for
prepending fails. (DLR) prepending fails. (DLR)
- Simplify the routine for closing the file just before we
indicate success on the statusbar. (DLR)
- rcfile.c: - rcfile.c:
parse_argument() parse_argument()
- Rename variable ptr_bak to ptr_save, for consistency. (DLR) - Rename variable ptr_bak to ptr_save, for consistency. (DLR)
......
...@@ -1622,11 +1622,8 @@ int write_file(const char *name, FILE *f_open, bool tmp, append_type ...@@ -1622,11 +1622,8 @@ int write_file(const char *name, FILE *f_open, bool tmp, append_type
strerror(errno)); strerror(errno));
goto cleanup_and_exit; goto cleanup_and_exit;
} }
} else if (fclose(f) == EOF) { } else
statusbar(_("Error writing %s: %s"), realname, strerror(errno)); fclose(f);
unlink(tempname);
goto cleanup_and_exit;
}
if (!tmp && append == OVERWRITE) { if (!tmp && append == OVERWRITE) {
if (!nonamechange) { if (!nonamechange) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment