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>
This commit is contained in:
parent
06cb6b1e9f
commit
f9704ce36e
@ -43,6 +43,7 @@ char *prompt(char *p) {
|
|||||||
// simple read string
|
// simple read string
|
||||||
static char buf[256];
|
static char buf[256];
|
||||||
fputs(p, stdout);
|
fputs(p, stdout);
|
||||||
|
fflush(stdout);
|
||||||
char *s = fgets(buf, sizeof(buf), stdin);
|
char *s = fgets(buf, sizeof(buf), stdin);
|
||||||
if (!s) {
|
if (!s) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user