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.
master
Benno Schulenberg 2020-05-29 11:57:33 +02:00
parent 512b0fd32d
commit 4b4a8be58b
1 changed files with 7 additions and 1 deletions

View File

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