From: Bryce Lanham Date: Tue, 11 Feb 2014 05:12:25 +0000 (-0600) Subject: Fixed prompt not showing properly in dumb frotz X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=f126f6684f550a8c47d7ed1d31769645d6e697a8;p=liskon_frotz.git 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. --- 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. */