[前][次][番号順一覧][スレッド一覧]

ruby-changes:8425

From: usa <ko1@a...>
Date: Mon, 27 Oct 2008 10:03:39 +0900 (JST)
Subject: [ruby-changes:8425] Ruby:r19956 (trunk): * io.c (read_all): the 3rd argument maybe Qnil.

usa	2008-10-27 10:03:22 +0900 (Mon, 27 Oct 2008)

  New Revision: 19956

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19956

  Log:
    * io.c (read_all): the 3rd argument maybe Qnil.

  Modified files:
    trunk/ChangeLog
    trunk/io.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 19955)
+++ ChangeLog	(revision 19956)
@@ -1,3 +1,7 @@
+Mon Oct 27 10:02:47 2008  NAKAMURA Usaku  <usa@r...>
+
+	* io.c (read_all): the 3rd argument maybe Qnil.
+
 Mon Oct 27 01:29:55 2008  Yusuke Endoh  <mame@t...>
 
 	* test/nkf/test_nkf.rb: add a test for [ruby-dev:36909].
Index: io.c
===================================================================
--- io.c	(revision 19955)
+++ io.c	(revision 19956)
@@ -1556,7 +1556,8 @@
     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) {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]