LibC: fflush stdout when reading from stdin
This is the *intended behaviour* per ISO C specification
This commit is contained in:
parent
2e2ee11452
commit
46dd411273
|
@ -542,6 +542,9 @@ int getc_unlocked(FILE* file)
|
||||||
if (file->eof)
|
if (file->eof)
|
||||||
return EOF;
|
return EOF;
|
||||||
|
|
||||||
|
if (file == stdin && file->buffer_type == _IOLBF && stdout->buffer_type == _IOLBF && stdout->buffer_idx)
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
// read characters from ungetc
|
// read characters from ungetc
|
||||||
if (file->unget_buf_idx)
|
if (file->unget_buf_idx)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue