aboutsummaryrefslogtreecommitdiff
path: root/runit
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2024-04-06 17:10:23 +0300
committerAvi Halachmi (:avih) <avihpit@yahoo.com>2024-04-06 17:53:14 +0300
commit2b8bc1b4760d8ecb4fdcdd79923d29d0ab20b908 (patch)
treef8096aba428d22b4ab64b6e24b2c1be8cf154498 /runit
parent54dbf0fa510afcd3058a5da66e1c4a390c2ba89b (diff)
downloadbusybox-w32-2b8bc1b4760d8ecb4fdcdd79923d29d0ab20b908.tar.gz
busybox-w32-2b8bc1b4760d8ecb4fdcdd79923d29d0ab20b908.tar.bz2
busybox-w32-2b8bc1b4760d8ecb4fdcdd79923d29d0ab20b908.zip
win32: UTF8_OUTPUT: flush stream before conversion
writeCon_utf8 is unbuffered - it writes directly using WriteConsoleW, but some winansi libc IO wrappers, like fputs, use the libc API directly if the content doesn't need any special handling (e.g. all ASCII and no escape sequences), and so if the stream is buffered, and if only some parts of it go through writeCon_utf8, then we can get wrong output order due to some parts being buffered and some not. Case in point, the recent commit 54dbf0fa5 made the output of "time" buffered, and so if only parts of it go through writeCon_utf8, then we get bad output order. This did actually happen, because not all the winasi wrappers have this ASCII-only optimization (e.g. winansi_putchar), and "time" did end up with wrong output order. Even if all the winansi wrappers were ASCII-optimized, "time" could still have unicode output, e.g. with -f. Fix it by flushing the stream before converting using writeCon_utf8.
Diffstat (limited to 'runit')
0 files changed, 0 insertions, 0 deletions