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
Этот коммит содержится в:
родитель
a5d8e54ab9
Коммит
bc503c80db
@ -1,8 +1,9 @@
|
|||||||
CVS code -
|
CVS code -
|
||||||
- files.c:
|
- files.c:
|
||||||
do_writeout()
|
do_writeout()
|
||||||
- Prompt the user if we're trying to save an existing file under
|
- Prompt the user if we're trying to save an existing file (and
|
||||||
a different name. (DLR; suggested by Jean-Philippe Guщrard)
|
not just a selection of it) under a different name. (DLR;
|
||||||
|
suggested by Jean-Philippe Guщrard)
|
||||||
- global.c:
|
- global.c:
|
||||||
shortcut_init()
|
shortcut_init()
|
||||||
- Allow WHEREIS_NEXT_KEY to be used in view mode. (DLR)
|
- Allow WHEREIS_NEXT_KEY to be used in view mode. (DLR)
|
||||||
@ -16,7 +17,6 @@ CVS code -
|
|||||||
generated at the statusbar prompt sometimes on Linux. (DLR)
|
generated at the statusbar prompt sometimes on Linux. (DLR)
|
||||||
- nano.spec.in:
|
- nano.spec.in:
|
||||||
- Update for the 1.3 branch of nano. (DLR)
|
- Update for the 1.3 branch of nano. (DLR)
|
||||||
|
|
||||||
- THANKS:
|
- THANKS:
|
||||||
- Add Danilo Segan, for the Serbian translation.
|
- Add Danilo Segan, for the Serbian translation.
|
||||||
|
|
||||||
|
18
src/files.c
18
src/files.c
@ -1834,15 +1834,19 @@ int do_writeout(const char *path, int exiting, int append)
|
|||||||
if (append == 0 && strcmp(answer, filename)) {
|
if (append == 0 && strcmp(answer, filename)) {
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
if (!stat(answer, &st))
|
if (!stat(answer, &st)) {
|
||||||
i = do_yesno(0, 0, _("File exists, OVERWRITE ?"));
|
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 ?"));
|
i = do_yesno(0, 0, _("Save file under DIFFERENT NAME ?"));
|
||||||
else
|
if (i == 0 || i == -1)
|
||||||
i = 1;
|
continue;
|
||||||
|
}
|
||||||
if (i == 0 || i == -1)
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user