simplify do_writeout()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4090 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Этот коммит содержится в:
родитель
5f7686f9b4
Коммит
462720a166
@ -1,3 +1,7 @@
|
|||||||
|
2007-04-21 David Lawrence Ramsey <pooka109@gmail.com>
|
||||||
|
|
||||||
|
* files.c (do_writeout): Simplify.
|
||||||
|
|
||||||
2007-04-19 David Lawrence Ramsey <pooka109@gmail.com>
|
2007-04-19 David Lawrence Ramsey <pooka109@gmail.com>
|
||||||
|
|
||||||
* files.c (tail): Remove unneeded if statement.
|
* files.c (tail): Remove unneeded if statement.
|
||||||
|
22
src/files.c
22
src/files.c
@ -1921,27 +1921,25 @@ bool do_writeout(bool exiting)
|
|||||||
free(full_answer);
|
free(full_answer);
|
||||||
|
|
||||||
if (do_warning) {
|
if (do_warning) {
|
||||||
if (name_exists) {
|
/* If we're using restricted mode, we aren't allowed
|
||||||
/* If we're using restricted mode, we aren't
|
* to overwrite an existing file with the current
|
||||||
* allowed to save a new file under the name of
|
* file. We also aren't allowed to change the name
|
||||||
* an existing file. */
|
* of the current file if it has one, because that
|
||||||
|
* would allow reading from or writing to files not
|
||||||
|
* specified on the command line. */
|
||||||
if (ISSET(RESTRICTED))
|
if (ISSET(RESTRICTED))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (name_exists) {
|
||||||
i = do_yesno_prompt(FALSE,
|
i = do_yesno_prompt(FALSE,
|
||||||
_("File exists, OVERWRITE ? "));
|
_("File exists, OVERWRITE ? "));
|
||||||
if (i == 0 || i == -1)
|
if (i == 0 || i == -1)
|
||||||
continue;
|
continue;
|
||||||
/* If we're using restricted mode, we aren't allowed
|
} else
|
||||||
* to change the name of a file once it has one,
|
|
||||||
* because that would allow reading from or writing
|
|
||||||
* to files not specified on the command line. */
|
|
||||||
} else if (!ISSET(RESTRICTED) &&
|
|
||||||
openfile->filename[0] != '\0'
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
&& (exiting || !openfile->mark_set)
|
if (exiting || !openfile->mark_set)
|
||||||
#endif
|
#endif
|
||||||
) {
|
{
|
||||||
i = do_yesno_prompt(FALSE,
|
i = do_yesno_prompt(FALSE,
|
||||||
_("Save file under DIFFERENT NAME ? "));
|
_("Save file under DIFFERENT NAME ? "));
|
||||||
if (i == 0 || i == -1)
|
if (i == 0 || i == -1)
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user