mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-24 11:54:01 +00:00
Also write \r to stdout on Windows if it is the last character to be written. Flush stdout afterwards so that frontends (e.g. mmg) receive the output immediately.
This commit is contained in:
parent
0bdb3d83c2
commit
5833f47656
@ -1167,10 +1167,11 @@ mm_stdio_c::write(const void *buffer,
|
|||||||
bytes_written = 0;
|
bytes_written = 0;
|
||||||
s = (const char *)buffer;
|
s = (const char *)buffer;
|
||||||
for (i = 0; i < size; ++i)
|
for (i = 0; i < size; ++i)
|
||||||
if (('\r' != s[i]) ||
|
if (('\r' != s[i]) || ((i + 1) == size) || ('\n' != s[i + 1]))
|
||||||
(((i + 1) < size) && ('\n' != s[i + 1])))
|
|
||||||
bytes_written += fwrite(&s[i], 1, 1, stdout);
|
bytes_written += fwrite(&s[i], 1, 1, stdout);
|
||||||
|
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
return bytes_written;
|
return bytes_written;
|
||||||
|
|
||||||
#else // defined(SYS_WINDOWS)
|
#else // defined(SYS_WINDOWS)
|
||||||
|
Loading…
Reference in New Issue
Block a user