From 30aaea2d04256470e27259acdf6ac507a1840d6a Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sat, 10 Jul 2021 15:56:38 +0200 Subject: [PATCH] tweaks: rename a variable and flip its logic, to avoid two negations Plus, it makes more sense to start in the state "not saved" than in the state "failed". --- src/nano.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nano.c b/src/nano.c index c5e0eee8..7fea3ace 100644 --- a/src/nano.c +++ b/src/nano.c @@ -313,7 +313,7 @@ void do_exit(void) * for a nameless buffer). If needed, the name is modified to be unique. */ void emergency_save(const char *plainname) { - bool failed = TRUE; + bool saved = FALSE; char *targetname; if (*plainname == '\0') @@ -322,9 +322,9 @@ void emergency_save(const char *plainname) targetname = get_next_filename(plainname, ".save"); if (*targetname != '\0') - failed = !write_file(targetname, NULL, TRUE, OVERWRITE, FALSE); + saved = write_file(targetname, NULL, TRUE, OVERWRITE, FALSE); - if (!failed) + if (saved) fprintf(stderr, _("\nBuffer written to %s\n"), targetname); else if (*targetname != '\0') fprintf(stderr, _("\nBuffer not written to %s: %s\n"),