summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-01 06:42:23 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-01 06:42:23 +0000
commit89c2ab70a44914663d1d1e3b4f0579f30cbdb4b7 (patch)
tree9a148f7260e621b0e1a22fca10cfc976f4e4e7f3 /io.c
parentd93187e81581bdcb7d2033c4c47ad33f7af9b966 (diff)
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
Diffstat (limited to 'io.c')
-rw-r--r--io.c6
1 files changed, 2 insertions, 4 deletions
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;