From f126f6684f550a8c47d7ed1d31769645d6e697a8 Mon Sep 17 00:00:00 2001 From: Bryce Lanham Date: Mon, 10 Feb 2014 23:12:25 -0600 Subject: [PATCH] Fixed prompt not showing properly in dumb frotz Prompt was not showing up until after user submitted a line, because prompts do not end with a newline, which would trigger fflush(). Adding a fflush() of stdout fixes this. --- src/dumb/dumb_input.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dumb/dumb_input.c b/src/dumb/dumb_input.c index 7238ba3..89be177 100644 --- a/src/dumb/dumb_input.c +++ b/src/dumb/dumb_input.c @@ -205,6 +205,8 @@ static bool dumb_read_line(char *s, char *prompt, bool show_cursor, fputs(prompt, stdout); else dumb_show_prompt(show_cursor, (timeout ? "tTD" : ")>}")[type]); + /* Prompt only shows up after user input if we don't flush stdout */ + fflush(stdout); dumb_getline(s); if ((s[0] != '\\') || ((s[1] != '\0') && !islower(s[1]))) { /* Is not a command line. */ -- 2.34.1