diff options
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -12092,9 +12092,8 @@ rb_io_s_copy_stream(int argc, VALUE *argv, VALUE io) static VALUE rb_io_external_encoding(VALUE io) { - rb_io_t *fptr; + rb_io_t *fptr = RFILE(rb_io_taint_check(io))->fptr; - GetOpenFile(io, fptr); if (fptr->encs.enc2) { return rb_enc_from_encoding(fptr->encs.enc2); } @@ -12117,9 +12116,8 @@ rb_io_external_encoding(VALUE io) static VALUE rb_io_internal_encoding(VALUE io) { - rb_io_t *fptr; + rb_io_t *fptr = RFILE(rb_io_taint_check(io))->fptr; - GetOpenFile(io, fptr); if (!fptr->encs.enc2) return Qnil; return rb_enc_from_encoding(io_read_encoding(fptr)); } |