mirror of
git://git.sv.gnu.org/nano.git
synced 2025-02-08 17:34:00 +03:00
files: show a warning when writing a backup fails, before prompting
Make the behavior similar to that of the other failure cases. Also, plug a tiny memory leak.
This commit is contained in:
parent
47953bd6ac
commit
586d22109b
@ -1688,10 +1688,12 @@ bool write_file(const char *name, FILE *thefile, bool tmp,
|
||||
goto cleanup_and_exit;
|
||||
} else if (verdict > 0) {
|
||||
fclose(backup_file);
|
||||
warn_and_briefly_pause(_("Cannot write backup"));
|
||||
if (user_wants_to_proceed())
|
||||
goto skip_backup;
|
||||
statusline(HUSH, _("Error writing backup file %s: %s"),
|
||||
statusline(HUSH, _("Cannot write backup %s: %s"),
|
||||
backupname, strerror(errno));
|
||||
free(backupname);
|
||||
goto cleanup_and_exit;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user