LibC: fflush stdout when reading from stdin
This is the *intended behaviour* per ISO C specification
This commit is contained in:
@@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user