Backport #4293
closedErrno::ENOMEM writing to STDOUT. Regression in 1.8.7-p330
Description
=begin
Hello,
A user reported an issue with patchlevel 330 when writing long strings to STDOUT:
http://groups.google.com/group/rubyinstaller/browse_thread/thread/91bda7b5cfc488ae
This issue is not present in patchlevel 302.
The only reference I can find of this is Issue #1063 [ruby-core:21613], which affects Ruby 1.9.x, but not 1.8.x
The following are the changes introduced between both:
https://github.com/ruby/ruby/compare/v1_8_7_302...v1_8_7_330
Been of special interest the ones in win32/win32.c:
https://github.com/ruby/ruby/compare/v1_8_7_302...v1_8_7_330#diff-36
Besides that one, no other significant modification was introduced.
Could this be the root of the regression? Reverting the changes on init_stdhandle seems to solve the issue.
Thank you.
=end