tweaks: reshuffle a condition, to avoid a repetition of code
parent
2623f39c7b
commit
8eddf7bc26
13
src/files.c
13
src/files.c
|
@ -1655,16 +1655,11 @@ bool make_backup_of(char *realname)
|
||||||
|
|
||||||
original = fopen(realname, "rb");
|
original = fopen(realname, "rb");
|
||||||
|
|
||||||
if (original == NULL) {
|
/* If opening succeeded, copy the existing file to the backup. */
|
||||||
warn_and_briefly_pause(_("Cannot read original file"));
|
if (original != NULL)
|
||||||
fclose(backup_file);
|
verdict = copy_file(original, backup_file, FALSE);
|
||||||
goto failure;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Copy the existing file to the backup. */
|
if (original == NULL || verdict < 0) {
|
||||||
verdict = copy_file(original, backup_file, FALSE);
|
|
||||||
|
|
||||||
if (verdict < 0) {
|
|
||||||
warn_and_briefly_pause(_("Cannot read original file"));
|
warn_and_briefly_pause(_("Cannot read original file"));
|
||||||
fclose(backup_file);
|
fclose(backup_file);
|
||||||
goto failure;
|
goto failure;
|
||||||
|
|
Loading…
Reference in New Issue