commit 90772ad05b186241136123890c6ac352de39f20f
parent 756b95748b8f65362484f04c6d562b4ba55d6454
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Thu, 28 May 2020 14:54:53 +0200
backup: do not understand ^C as "Yes" when asking whether to continue
This fixes https://savannah.gnu.org/bugs/?58443.
Bug existed since version 2.3.0, commit 3d411188.
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/files.c b/src/files.c
@@ -1477,11 +1477,11 @@ bool outside_of_confinement(const char *currpath, bool allow_tabcomp)
#ifndef NANO_TINY
/* Although this sucks, it sucks less than having a single 'my system is
* messed up and I'm blanket allowing insecure file writing operations'. */
-int prompt_failed_backupwrite(const char *filename)
+bool prompt_failed_backupwrite(const char *filename)
{
- static int choice;
static char *prevfile = NULL;
/* The last filename we were passed, so we don't keep asking this. */
+ static int choice = 0;
if (prevfile == NULL || strcmp(filename, prevfile)) {
choice = do_yesno_prompt(FALSE, _("Failed to write backup file; "
@@ -1489,7 +1489,7 @@ int prompt_failed_backupwrite(const char *filename)
prevfile = mallocstrcpy(prevfile, filename);
}
- return choice;
+ return (choice == 1);
}
/* Transform the specified backup directory to an absolute path,