diff --git a/ChangeLog b/ChangeLog
index ff40029564b51bd1009444f669cd87e956e99824..6fa21f48b08c94e6306c7a92f13a2102b9b03fb7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -41,8 +41,9 @@ CVS code -
 	  file browser shortcut list. (DLR)
 - prompt.c:
   get_prompt_string()
-	- Use a do/while loop instead of a while loop, for consistency.
-	  (DLR)
+	- Use a do/while loop instead of a while loop, for consistency,
+	  and initialize finished to FALSE to make sure it works
+	  properly. (DLR)
 	- Redraw the prompt and set finished to FALSE when NANO_HELP_KEY
 	  is pressed, so that we don't leave the prompt, enter the help
 	  browser, and restart the prompt after leaving it.  This will
diff --git a/src/prompt.c b/src/prompt.c
index 61575d3da1696bd46072b0624afa291d1d5bef6b..7efab22fd083a76d3452ed12d0b2faeaafdb7bdb 100644
--- a/src/prompt.c
+++ b/src/prompt.c
@@ -912,7 +912,7 @@ int get_prompt_string(bool allow_tabs,
 	)
 {
     int kbinput = ERR;
-    bool meta_key, func_key, s_or_t, ran_func, finished;
+    bool meta_key, func_key, s_or_t, ran_func, finished = FALSE;
     size_t curranswer_len;
 #ifndef DISABLE_TABCOMP
     bool tabbed = FALSE;