don't prompt if we're saving only a selection of a file under a

different name


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1590 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
David Lawrence Ramsey
2003-11-19 23:59:14 +00:00
parent a5d8e54ab9
commit bc503c80db
2 changed files with 14 additions and 10 deletions

View File

@@ -1834,15 +1834,19 @@ int do_writeout(const char *path, int exiting, int append)
if (append == 0 && strcmp(answer, filename)) {
struct stat st;
if (!stat(answer, &st))
if (!stat(answer, &st)) {
i = do_yesno(0, 0, _("File exists, OVERWRITE ?"));
else if (filename[0] != '\0')
if (i == 0 || i == -1)
continue;
} else if (filename[0] != '\0'
#ifndef NANO_SMALL
&& (!ISSET(MARK_ISSET) || exiting)
#endif
) {
i = do_yesno(0, 0, _("Save file under DIFFERENT NAME ?"));
else
i = 1;
if (i == 0 || i == -1)
continue;
if (i == 0 || i == -1)
continue;
}
}
#ifndef NANO_SMALL