nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 7dbfbbb8d6a542201ce56d4f60a2b7b5861d5d7b
parent 4cefd699cab643eac41c891c049c1f886cf1add1
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri, 17 Jul 2020 17:13:43 +0200

tweaks: reshuffle a few lines, for conciseness

Diffstat:
Msrc/files.c | 10++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/files.c b/src/files.c @@ -1702,25 +1702,23 @@ bool make_backup_of(char *realname) second_attempt = TRUE; goto retry; - } + } else + warn_and_briefly_pause(_("Cannot make backup")); - warn_and_briefly_pause(_("Cannot make backup")); failure: warn_and_briefly_pause(strerror(errno)); currmenu = MMOST; + free(backupname); /* If both attempts failed, and it isn't because of lack of disk space, * ask the user what to do, because if something goes wrong during the * save of the file itself, its contents may be lost. */ if (errno != ENOSPC && do_yesno_prompt(FALSE, _("Cannot make backup; " - "continue and save actual file? ")) == 1) { - free(backupname); + "continue and save actual file? ")) == 1) return TRUE; - } /* TRANSLATORS: The %s is the reason of failure. */ statusline(HUSH, _("Cannot make backup: %s"), strerror(errno)); - free(backupname); return FALSE; } #endif /* !NANO_TINY */