From 89c2ab70a44914663d1d1e3b4f0579f30cbdb4b7 Mon Sep 17 00:00:00 2001 From: yugui Date: Thu, 1 Jan 2009 06:42:23 +0000 Subject: merges r21209 from trunk into ruby_1_9_1. * io.c (copy_stream_body): don't check to_io because Zlib::GzipWriter#to_io returns the underlying IO. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index 7aeeeb8f1d..88f1c51e52 100644 --- a/io.c +++ b/io.c @@ -7653,13 +7653,12 @@ copy_stream_body(VALUE arg) if (stp->src == argf || !(TYPE(stp->src) == T_FILE || - rb_respond_to(stp->src, rb_intern("to_io")) || TYPE(stp->src) == T_STRING || rb_respond_to(stp->src, rb_intern("to_path")))) { src_fd = -1; } else { - src_io = rb_check_convert_type(stp->src, T_FILE, "IO", "to_io"); + src_io = TYPE(stp->src) == T_FILE ? stp->src : Qnil; if (NIL_P(src_io)) { VALUE args[2]; int oflags = O_RDONLY; @@ -7681,13 +7680,12 @@ copy_stream_body(VALUE arg) if (stp->dst == argf || !(TYPE(stp->dst) == T_FILE || - rb_respond_to(stp->dst, rb_intern("to_io")) || TYPE(stp->dst) == T_STRING || rb_respond_to(stp->dst, rb_intern("to_path")))) { dst_fd = -1; } else { - dst_io = rb_check_convert_type(stp->dst, T_FILE, "IO", "to_io"); + dst_io = TYPE(stp->dst) == T_FILE ? stp->dst : Qnil; if (NIL_P(dst_io)) { VALUE args[3]; int oflags = O_WRONLY|O_CREAT|O_TRUNC; -- cgit v1.2.3