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

ruby-changes:3758

From: ko1@a...
Date: Sat, 26 Jan 2008 09:19:10 +0900 (JST)
Subject: [ruby-changes:3758] naruse - Ruby:r15247 (trunk): * string.c (rb_str_new): set US-ASCII and ENC_CODERANGE_7BIT when

naruse	2008-01-26 09:18:50 +0900 (Sat, 26 Jan 2008)

  New Revision: 15247

  Modified files:
    trunk/ChangeLog
    trunk/string.c

  Log:
    * string.c (rb_str_new): set US-ASCII and ENC_CODERANGE_7BIT when
      empty string (len == 0).


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/string.c?r1=15247&r2=15246&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15247&r2=15246&diff_format=u

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 15246)
+++ ChangeLog	(revision 15247)
@@ -1,3 +1,8 @@
+Sat Jan 26 09:17:13 2008  NARUSE, Yui  <naruse@r...>
+
+	* string.c (rb_str_new): set US-ASCII and ENC_CODERANGE_7BIT when
+	  empty string (len == 0).
+
 Sat Jan 26 03:41:53 2008  NAKAMURA Usaku  <usa@r...>
 
 	* parse.y (parser_initialize): set default script encoding as US-ASCII.
Index: string.c
===================================================================
--- string.c	(revision 15246)
+++ string.c	(revision 15247)
@@ -278,7 +278,7 @@
     if (ptr) {
 	memcpy(RSTRING_PTR(str), ptr, len);
     }
-    else {
+    if (len == 0) {
 	ENCODING_CODERANGE_SET(str, rb_usascii_encindex(), ENC_CODERANGE_7BIT);
     }
     STR_SET_LEN(str, len);

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

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