stdout log emitter: flush stdout after every printf() if stdout is not a terminal

This makes it possible to watch aegisub's output in realtime even if its
stdout is redirected to a file.

Originally committed to SVN as r6793.
This commit is contained in:
cantabile 2012-05-15 14:06:18 +00:00 committed by Thomas Goyne
parent d38e02c031
commit 54a08a44c1
1 changed files with 2 additions and 0 deletions

View File

@ -46,6 +46,8 @@ void EmitSTDOUT::log(SinkMessage *sm) {
sm->line,
(int)sm->len,
sm->message);
if (!isatty(fileno(stdout)))
fflush(stdout);
}
} // namespace log