]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #12396 : alexcrichton/rust/windows-env-var, r=huonw
authorbors <bors@rust-lang.org>
Thu, 20 Feb 2014 08:36:53 +0000 (00:36 -0800)
committerbors <bors@rust-lang.org>
Thu, 20 Feb 2014 08:36:53 +0000 (00:36 -0800)
On windows, the GetEnvironmentVariable function will return the necessary buffer
size if the buffer provided was too small. This case previously fell through the
checks inside of fill_utf16_buf_and_decode, tripping an assertion in the `slice`
method.

This adds an extra case for when the return value is >= the buffer size, in
which case we assume the return value as the new buffer size and try again.

Closes #12376


Trivial merge