Flush file in fputc when character is '\n'.
This commit is contained in:
parent
36aee71988
commit
b100339e2f
|
@ -2222,6 +2222,12 @@ int MSVCRT_fputc(int c, MSVCRT_FILE* file)
|
|||
if(file->_cnt>0) {
|
||||
*file->_ptr++=c;
|
||||
file->_cnt--;
|
||||
if (c == '\n')
|
||||
{
|
||||
int res = msvcrt_flush_buffer(file);
|
||||
return res ? res : c;
|
||||
}
|
||||
else
|
||||
return c;
|
||||
} else {
|
||||
return MSVCRT__flsbuf(c, file);
|
||||
|
|
Loading…
Reference in New Issue