diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-21 04:32:53 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-21 04:32:53 +0000 |
commit | ad47716266cc8048b6ec1c8d73490cfe06a05657 (patch) | |
tree | 46e049599c7adf771e3a507613137aa9a1679751 | |
parent | 1b27cfcd6ca0bcf7b75be27de4746cd030b7c1d4 (diff) | |
download | ruby-ad47716266cc8048b6ec1c8d73490cfe06a05657.tar.gz |
* io.c (rb_io_external_encoding): should fill delayed
initialization for STDIN.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | io.c | 3 |
2 files changed, 6 insertions, 0 deletions
@@ -5,6 +5,9 @@ Fri Dec 21 13:10:57 2007 Yukihiro Matsumoto <matz@ruby-lang.org> * encoding.c (rb_enc_from_encoding): returns Qnil for NULL encoding. + * io.c (rb_io_external_encoding): should fill delayed + initialization for STDIN. + Fri Dec 21 13:09:11 2007 Tanaka Akira <akr@fsij.org> * encoding.c (rb_locale_charmap): return nil if no locale information. @@ -5671,6 +5671,9 @@ rb_io_external_encoding(VALUE io) rb_io_t *fptr; GetOpenFile(io, fptr); + if (!fptr->enc && fptr->fd == 0) { + fptr->enc = rb_default_external_encoding(); + } return rb_enc_from_encoding(fptr->enc); } |