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 <tpapastylianou@hotmail.com>

Bug existed since version 2.9.0, commit 217cfbf3.
This commit is contained in:
Benno Schulenberg 2022-01-21 15:44:07 +01:00
parent ebf6228f21
commit 1c074cc8cc

View File

@ -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;