diff --git a/ChangeLog b/ChangeLog
index 7a11e5811cab372af39b0e065a05c3ea73ff75ed..5e3ed6ddb0555d72d80f4a28d72da61da4546dec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -35,6 +35,10 @@ CVS code -
 - files.c:
   is_dir()
 	- Rename parameter ret to retval, for consistency. (DLR)
+- prompt.c:
+  get_prompt_string()
+	- Use a do/while loop instead of a while loop, for consistency.
+	  (DLR)
 - utils.c:
   ngetdelim()
 	- Do sanity checks manually again instead of in an assert, and
diff --git a/src/prompt.c b/src/prompt.c
index c745eb2b87df9d75a14e1f69f42e7f44c0c30e32..e31da89343bf96f533bb716fd42abff4c76dbcb3 100644
--- a/src/prompt.c
+++ b/src/prompt.c
@@ -911,7 +911,7 @@ int get_prompt_string(bool allow_tabs,
 #endif
 	)
 {
-    int kbinput;
+    int kbinput = ERR;
     bool meta_key, func_key, s_or_t, ran_func, finished;
     size_t curranswer_len;
 #ifndef DISABLE_TABCOMP
@@ -961,10 +961,7 @@ int get_prompt_string(bool allow_tabs,
      * to files not specified on the command line.  In this case,
      * disable all keys that would change the text if the filename isn't
      * blank and we're at the "Write File" prompt. */
-    while ((kbinput = do_statusbar_input(&meta_key, &func_key,
-	&s_or_t, &ran_func, &finished, TRUE)) != NANO_CANCEL_KEY &&
-	kbinput != NANO_ENTER_KEY) {
-
+    do {
 	assert(statusbar_x <= strlen(answer));
 
 #ifndef DISABLE_TABCOMP
@@ -1063,7 +1060,9 @@ int get_prompt_string(bool allow_tabs,
 #endif
 
 	reset_statusbar_cursor();
-    }
+    } while ((kbinput = do_statusbar_input(&meta_key, &func_key,
+	&s_or_t, &ran_func, &finished, TRUE)) != NANO_CANCEL_KEY &&
+	kbinput != NANO_ENTER_KEY);
 
 #ifndef NANO_TINY
     /* Set the current position in the history list to the bottom and