summaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-26 04:30:45 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-26 04:30:45 +0000
commitec2e9025ed38a32b5a86435df975601558bfb48a (patch)
tree3cc6837b7abd9b1d9c407d109dda0b8000754278 /io.c
parentf5ab335a53887e671437422cbc18f9b6b79ca84e (diff)
downloadruby-ec2e9025ed38a32b5a86435df975601558bfb48a.tar.gz
ruby-ec2e9025ed38a32b5a86435df975601558bfb48a.tar.xz
ruby-ec2e9025ed38a32b5a86435df975601558bfb48a.zip
* io.c (read_all): use the given buffer to read when needs readconv.
based on the patch by wanabe <s.wanabe AT gmail.com> at [ruby-dev:36931]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index bfeefef43..125180b92 100644
--- a/io.c
+++ b/io.c
@@ -1556,7 +1556,7 @@ read_all(rb_io_t *fptr, long siz, VALUE str)
int cr;
if (NEED_READCONV(fptr)) {
- VALUE str = rb_str_new(NULL, 0);
+ if (!NIL_P(str)) rb_str_set_len(str, 0);
make_readconv(fptr);
while (1) {
if (fptr->cbuf_len) {