commit 380589d95d5daff5dd76d2aac21fdb5f8718dc3b
parent bb496bf456d64192479642f4ae30419e783728ed
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 21 Jun 2020 09:18:24 +0200
tweaks: reshuffle and trim a comment, and remove unneeded pair of braces
Diffstat:
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/files.c b/src/files.c
@@ -2042,9 +2042,9 @@ int do_writeout(bool exiting, bool withprompt)
#endif
while (TRUE) {
- const char *msg;
int response = 0, choice = 0;
functionptrtype func;
+ const char *msg;
#ifndef NANO_TINY
const char *formatstr, *backupstr;
@@ -2069,13 +2069,12 @@ int do_writeout(bool exiting, bool withprompt)
present_path = mallocstrcpy(present_path, "./");
- /* When we shouldn't prompt, use the existing filename. */
+ /* When we shouldn't prompt, use the existing filename.
+ * Otherwise, ask for (confirmation of) the filename. */
if ((!withprompt || (ISSET(SAVE_ON_EXIT) && exiting)) &&
openfile->filename[0] != '\0')
answer = mallocstrcpy(answer, openfile->filename);
- else {
- /* Ask for (confirmation of) the filename. Disable tab completion
- * when in restricted mode. */
+ else
response = do_prompt(MWRITEFILE, given, NULL,
edit_refresh, "%s%s%s", msg,
#ifndef NANO_TINY
@@ -2084,7 +2083,6 @@ int do_writeout(bool exiting, bool withprompt)
"", ""
#endif
);
- }
if (response < 0) {
statusbar(_("Cancelled"));