console/linenoise: support buffered stdout

This commit is contained in:
Ivan Grokhotkov 2019-03-13 20:17:25 +08:00
parent c97a05c0d5
commit 6ce5c7668f

View file

@ -106,6 +106,7 @@
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdio_ext.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
@ -879,6 +880,9 @@ static int linenoiseEdit(char *buf, size_t buflen, const char *prompt)
linenoiseEditDeletePrevWord(&l);
break;
}
if (__fbufsize(stdout) > 0) {
fflush(stdout);
}
}
return l.len;
}