From 4663c52df22713f88fdafa807affa428301058e9 Mon Sep 17 00:00:00 2001 From: usa Date: Mon, 27 Oct 2008 01:03:22 +0000 Subject: * io.c (read_all): the 3rd argument maybe Qnil. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ io.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 55a31dcca..3839b1ae4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Oct 27 10:02:47 2008 NAKAMURA Usaku + + * io.c (read_all): the 3rd argument maybe Qnil. + Mon Oct 27 01:29:55 2008 Yusuke Endoh * test/nkf/test_nkf.rb: add a test for [ruby-dev:36909]. diff --git a/io.c b/io.c index 125180b92..ff1c74a3e 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) { -- cgit