more miscellaneous minor fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3999 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2006-12-14 22:11:44 +00:00
parent 8060d66158
commit ad64cd97b8
1 changed files with 19 additions and 21 deletions

View File

@ -1906,11 +1906,10 @@ int do_writeout(bool exiting)
if (full_answer != NULL) if (full_answer != NULL)
free(full_answer); free(full_answer);
if (different_name) {
if (name_exists) { if (name_exists) {
/* If we're using restricted mode, we aren't /* If we're using restricted mode, we aren't allowed
* allowed to save a new file under the name of * to save a new file under the name of an existing
* an existing file. */ * file. */
if (ISSET(RESTRICTED)) if (ISSET(RESTRICTED))
continue; continue;
@ -1918,11 +1917,11 @@ int do_writeout(bool exiting)
_("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 /* If we're using restricted mode, we aren't allowed to
* to change the name of a file once it has one, * change the name of a file once it has one, because
* because that would allow reading from or writing * that would allow reading from or writing to files not
* to files not specified on the command line. */ * specified on the command line. */
} else if (!ISSET(RESTRICTED) && } else if (different_name && !ISSET(RESTRICTED) &&
openfile->filename[0] != '\0' openfile->filename[0] != '\0'
#ifndef NANO_TINY #ifndef NANO_TINY
&& (exiting || !openfile->mark_set) && (exiting || !openfile->mark_set)
@ -1934,7 +1933,6 @@ int do_writeout(bool exiting)
continue; continue;
} }
} }
}
/* Convert newlines to nulls, just before we save the /* Convert newlines to nulls, just before we save the
* file. */ * file. */