commit 225203d40df0e93d68e599ed1f85eca60267bf22
parent c2a0c78d9b11d8a28e867f435b9406a8a1ab5d84
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Fri, 15 Jul 2016 13:03:42 +0200
tweaks: correct a comment
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/files.c b/src/files.c
@@ -1698,8 +1698,8 @@ int copy_file(FILE *inn, FILE *out)
* method is APPEND, it means we are appending instead of overwriting.
* If method is PREPEND, it means we are prepending instead of
* overwriting. If nonamechange is TRUE, we don't change the current
- * filename. nonamechange is ignored if tmp is FALSE, we're appending,
- * or we're prepending.
+ * filename. nonamechange is irrelevant when appending or prepending,
+ * or when writing a temporary file.
*
* Return TRUE on success or FALSE on error. */
bool write_file(const char *name, FILE *f_open, bool tmp,
@@ -2111,7 +2111,7 @@ bool write_file(const char *name, FILE *f_open, bool tmp,
goto cleanup_and_exit;
}
- if (!tmp && method == OVERWRITE) {
+ if (method == OVERWRITE && !tmp) {
/* If we must set the filename, and it changed, adjust things. */
if (!nonamechange && strcmp(openfile->filename, realname) != 0) {
#ifndef DISABLE_COLOR