kopia lustrzana https://github.com/micropython/micropython
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
rodzic
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;
|
||||||
|
|
Ładowanie…
Reference in New Issue