From 4b4a8be58bab7d492810774aba5a8522db6aae11 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 29 May 2020 11:57:33 +0200 Subject: [PATCH] files: before prompting, show also the reason why the backup failed Also, do not prompt when there is no space left on the device, because then trying to save the actual file would likely lead to truncating it, resulting in an empty file. --- src/files.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/files.c b/src/files.c index 8eb8c80e..6ddead29 100644 --- a/src/files.c +++ b/src/files.c @@ -1479,7 +1479,13 @@ bool outside_of_confinement(const char *currpath, bool allow_tabcomp) * messed up and I'm blanket allowing insecure file writing operations'. */ bool user_wants_to_proceed(void) { - return (do_yesno_prompt(FALSE, _("Cannot make backup; " + warn_and_briefly_pause(strerror(errno)); + + if (errno == ENOSPC) { + currmenu = MMOST; + return FALSE; + } else + return (do_yesno_prompt(FALSE, _("Cannot make backup; " "continue and save actual file? ")) == 1); }