unix/input: Flush the prompt after writing it to stdout.

Depending on your setup, stdout might be buffered/line-buffered.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
pull/13673/head
YAMAMOTO Takashi 2024-02-13 18:46:17 +09:00 zatwierdzone przez Damien George
rodzic 06cb6b1e9f
commit f9704ce36e
1 zmienionych plików z 1 dodań i 0 usunięć

Wyświetl plik

@ -43,6 +43,7 @@ char *prompt(char *p) {
// simple read string
static char buf[256];
fputs(p, stdout);
fflush(stdout);
char *s = fgets(buf, sizeof(buf), stdin);
if (!s) {
return NULL;