diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-10-23 23:19:14 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-10-23 23:19:14 +0000 |
commit | a28fe36c89cca3ae402f657f6bb8ebf038c23175 (patch) | |
tree | ea39ef54005559c4f53cab42094b9402f2e35653 /io.c | |
parent | b062e60805c9be8c6267d3ad17bd5fbd0c0c8a83 (diff) | |
download | ruby-a28fe36c89cca3ae402f657f6bb8ebf038c23175.tar.gz |
* io.c (copy_stream_fallback_body): check nil for EOF of read method.
patch by Eric Wong. [ruby-core:39134] [Bug #5237]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -8998,7 +8998,10 @@ copy_stream_fallback_body(VALUE arg) l = buflen < rest ? buflen : (long)rest; } if (stp->src_fd == -1) { - rb_funcall(stp->src, read_method, 2, INT2FIX(l), buf); + VALUE rc = rb_funcall(stp->src, read_method, 2, INT2FIX(l), buf); + + if (read_method == id_read && NIL_P(rc)) + break; } else { ssize_t ss; |