]> git.lizzy.rs Git - rust.git/commit
Fixup stout/stderr on Windows
authorOliver Middleton <olliemail27@gmail.com>
Thu, 10 Mar 2016 19:09:02 +0000 (19:09 +0000)
committerOliver Middleton <olliemail27@gmail.com>
Thu, 10 Mar 2016 21:15:23 +0000 (21:15 +0000)
commit8427efaab377346c0c4be73664422897a4072330
tree69723a049b19d200f1eb35ff9778750f894282d6
parent4b87655e69a6d07f03b104caaec80a042ad40bf1
Fixup stout/stderr on Windows

WriteConsoleW can fail if called with a large buffer so we need to slice
any stdout/stderr output.
However the current slicing has a few problems:
 1. It slices by byte but still expects valid UTF-8.
 2. The slicing happens even when not outputting to a console.
 3. panic! output is not sliced.

This fixes these issues by moving the slice to right before
WriteConsoleW and slicing on a char boundary.
src/libstd/io/stdio.rs
src/libstd/sys/windows/stdio.rs