diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-02 08:06:23 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-02 08:06:23 +0000 |
| commit | 9b6125398f81ae359a67b00fcfab8cc08ebcbe8d (patch) | |
| tree | c2ac057ba0601925b48b5c7a0bdbefec111a72c7 | |
| parent | 93d4433c14d87a32e5fec5fab678a6b1a94beaab (diff) | |
merges r29435 from trunk into ruby_1_9_2.
--
* io.c (rb_io_set_encoding): use rb_funcall2 when the io is not
a T_FILE. [ruby-dev:42356]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | io.c | 7 | ||||
| -rw-r--r-- | version.h | 2 |
3 files changed, 12 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Mon Oct 11 06:11:30 2010 NARUSE, Yui <naruse@ruby-lang.org> + + * io.c (rb_io_set_encoding): use rb_funcall2 when the io is not + a T_FILE. [ruby-dev:42356] + Fri Oct 8 00:24:54 2010 James Edward Gray II <jeg2@ruby-lang.org> * lib/csv.rb: Fixing documentation typos. [ruby-core:32712] @@ -137,7 +137,7 @@ VALUE rb_default_rs; static VALUE argf; -static ID id_write, id_read, id_getc, id_flush, id_readpartial; +static ID id_write, id_read, id_getc, id_flush, id_readpartial, id_set_encoding; static VALUE sym_mode, sym_perm, sym_extenc, sym_intenc, sym_encoding, sym_open_args; static VALUE sym_textmode, sym_binmode, sym_autoclose; @@ -8661,6 +8661,10 @@ rb_io_set_encoding(int argc, VALUE *argv, VALUE io) rb_io_t *fptr; VALUE v1, v2, opt; + if (TYPE(io) != T_FILE) { + return rb_funcall2(io, id_set_encoding, argc, argv); + } + opt = pop_last_hash(&argc, argv); rb_scan_args(argc, argv, "11", &v1, &v2); GetOpenFile(io, fptr); @@ -9838,6 +9842,7 @@ Init_IO(void) id_getc = rb_intern("getc"); id_flush = rb_intern("flush"); id_readpartial = rb_intern("readpartial"); + id_set_encoding = rb_intern("set_encoding"); rb_define_global_function("syscall", rb_f_syscall, -1); @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 64 +#define RUBY_PATCHLEVEL 65 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 |
