From fbc4429d727161c2e002863d2f9ab2cb823941d2 Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 13 Jan 2009 09:21:14 +0000 Subject: * io.c (rb_io_initialize): workaround for Windows. [ruby-dev:37686] (also see [ruby-dev:37721]) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ io.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 49d2292b30..e687418c2b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Jan 13 18:19:49 2009 NAKAMURA Usaku + + * io.c (rb_io_initialize): workaround for Windows. [ruby-dev:37686] + (also see [ruby-dev:37721]) + Tue Jan 13 17:29:02 2009 Nobuyoshi Nakada * enc/trans/make_transdb.rb (converters): should not depend on the diff --git a/io.c b/io.c index 46136d7ee7..5e50b0981d 100644 --- a/io.c +++ b/io.c @@ -5963,6 +5963,12 @@ rb_io_initialize(int argc, VALUE *argv, VALUE io) fp->encs = convconfig; clear_codeconv(fp); io_check_tty(fp); + if (fileno(stdin) == fd) + fp->stdio_file = stdin; + else if (fileno(stdout) == fd) + fp->stdio_file = stdout; + else if (fileno(stderr) == fd) + fp->stdio_file = stderr; return io; } -- cgit v1.2.3