summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-27 01:03:22 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-27 01:03:22 +0000
commitdb8e3024e74dafa1f76d8d43a1bddfc1270ad073 (patch)
treebbb75623bb93ad6d88da7ad72fbe50d66ff19d89 /io.c
parent52061f4ecd3b6effb6b35f1aec30061fbc9f7fdb (diff)
* io.c (read_all): the 3rd argument maybe Qnil.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/io.c b/io.c
index 125180b925..ff1c74a3e3 100644
--- a/io.c
+++ b/io.c
@@ -1556,7 +1556,8 @@ read_all(rb_io_t *fptr, long siz, VALUE str)
int cr;
if (NEED_READCONV(fptr)) {
- if (!NIL_P(str)) rb_str_set_len(str, 0);
+ if (NIL_P(str)) str = rb_str_new(NULL, 0);
+ else rb_str_set_len(str, 0);
make_readconv(fptr);
while (1) {
if (fptr->cbuf_len) {