From bd1fcc5fe20912221e220795d1bdce6e6d13d7b4 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Sat, 6 Aug 2016 12:15:03 +0200
Subject: [PATCH] tweaks: correct one comment, and adjust another

---
 src/prompt.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/prompt.c b/src/prompt.c
index 3074408d..4c7d6942 100644
--- a/src/prompt.c
+++ b/src/prompt.c
@@ -90,15 +90,13 @@ int do_statusbar_input(bool *ran_func, bool *finished,
 	}
     }
 
-    /* If we got a character, and it isn't a shortcut or toggle,
-     * it's a normal text character.  Display the warning if we're
-     * in view mode, or add the character to the input buffer if
-     * we're not. */
+    /* If the keystroke isn't a shortcut nor a toggle, it's a normal text
+     * character: add the it to the input buffer, when allowed. */
     if (input != ERR && !have_shortcut) {
-	/* If we're using restricted mode, the filename isn't blank,
-	 * and we're at the "Write File" prompt, disable text input. */
-	if (!ISSET(RESTRICTED) || openfile->filename[0] == '\0' ||
-		currmenu != MWRITEFILE) {
+	/* Only accept input when not in restricted mode, or when not at
+	 * the "Write File" prompt, or when there is no filename yet. */
+	if (!ISSET(RESTRICTED) || currmenu != MWRITEFILE ||
+			openfile->filename[0] == '\0') {
 	    kbinput_len++;
 	    kbinput = (int *)nrealloc(kbinput, kbinput_len * sizeof(int));
 	    kbinput[kbinput_len - 1] = input;
-- 
GitLab