From 0db5641dae711ccb3e34cc195e14f95571c22f90 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 26 Oct 2008 04:30:45 +0000 Subject: * io.c (read_all): use the given buffer to read when needs readconv. based on the patch by wanabe at [ruby-dev:36931]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'io.c') diff --git a/io.c b/io.c index bfeefef432..125180b925 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) { -- cgit v1.2.3