diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-21 05:47:12 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-21 05:47:12 +0000 |
commit | 7f2ca5ba7a5afd95354d7ea9a39741cebff38e70 (patch) | |
tree | b724185f18f370755cb8264d89b205881cd8f4bb /io.c | |
parent | 3ce61d2a639a47d505fa9179d6d41f774c85ad92 (diff) | |
download | ruby-7f2ca5ba7a5afd95354d7ea9a39741cebff38e70.tar.gz |
* io.c (argf_set_encoding): uses current_file after check for next
input.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -6103,8 +6103,11 @@ argf_set_encoding(int argc, VALUE *argv, VALUE io) { rb_io_t *fptr; + if (next_argv()) { + rb_raise(rb_eArgError, "no stream to set encoding"); + } rb_io_set_encoding(argc, argv, current_file); - GetOpenFile(io, fptr); + GetOpenFile(current_file, fptr); argf_enc = fptr->enc; argf_enc2 = fptr->enc2; return io; |