summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-15 15:37:42 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-15 15:37:42 +0000
commit71e891ff3eb68669ec2e5833c89add38cffdc3d0 (patch)
tree70511bce05e1b541c202c1e09e312cd62e080f90
parentb9c12d8a566f5bba762ab1214ef2fe0d88dba96d (diff)
merges r21491 from trunk into ruby_1_9_1.
* io.c (rb_io_initialize): workaround for Windows. [ruby-dev:37686] (also see [ruby-dev:37721]) git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--io.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 85c317815..c708a71b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Jan 13 18:19:49 2009 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * 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 <nobu@ruby-lang.org>
* enc/trans/make_transdb.rb (converters): should not depend on the
diff --git a/io.c b/io.c
index 4cc8e749e..59e5274ba 100644
--- a/io.c
+++ b/io.c
@@ -5928,6 +5928,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;
}