From 1c074cc8cc9002f2f044be809a5e901046970411 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 21 Jan 2022 15:44:07 +0100 Subject: [PATCH] files: let ^C cancel the exiting when the file on disk was changed When the user exits with ^X and gets warned that the file on disk has changed, then typing ^C at the question whether to continue saving should not discard the buffer and exit, but should return the user to the filename prompt. This fixes https://savannah.gnu.org/bugs/?61883. Reported-by: Tasos Papastylianou Bug existed since version 2.9.0, commit 217cfbf3. --- src/files.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/files.c b/src/files.c index 9c41936f..cd3da18e 100644 --- a/src/files.c +++ b/src/files.c @@ -2306,6 +2306,8 @@ int write_it_out(bool exiting, bool withprompt) return 2; else return 0; + } else if (choice < 0 && exiting) { + continue; } else if (choice != 1) { free(given); return 1;