commit 4e40ec057eb3c8e81ca0a5f45f1773701529ff2a
parent bd0026be86cf4ee5ae2acd766badb835ced4dd7a
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Thu, 17 Oct 2019 11:23:22 +0200
tweaks: elide an unneeded check when making a backup
When making a backup, we can be certain that the relevant file
is not a temporary file, so 'stream' will necessarily be NULL.
Diffstat:
1 file changed, 0 insertions(+), 2 deletions(-)
diff --git a/src/files.c b/src/files.c
@@ -1570,7 +1570,6 @@ bool write_file(const char *name, FILE *stream, bool tmp,
filetime[0].tv_sec = openfile->current_stat->st_atime;
filetime[1].tv_sec = openfile->current_stat->st_mtime;
- if (stream == NULL) {
/* Open the original file to copy to the backup. */
f = fopen(realname, "rb");
@@ -1582,7 +1581,6 @@ bool write_file(const char *name, FILE *stream, bool tmp,
* nothing. */
goto skip_backup;
}
- }
/* If backup_dir is set, we set backupname to
* backup_dir/backupname~[.number], where backupname is the