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

ruby-changes:18979

From: naruse <ko1@a...>
Date: Thu, 3 Mar 2011 19:43:18 +0900 (JST)
Subject: [ruby-changes:18979] Ruby:r31015 (trunk): * string.c (rb_str_slice_bang): raise error when the string is frozen.

naruse	2011-03-03 18:59:51 +0900 (Thu, 03 Mar 2011)

  New Revision: 31015

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

  Log:
    * string.c (rb_str_slice_bang): raise error when the string is frozen.

  Modified files:
    trunk/ChangeLog
    trunk/string.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 31014)
+++ ChangeLog	(revision 31015)
@@ -1,3 +1,7 @@
+Thu Mar  3 18:59:04 2011  NARUSE, Yui  <naruse@r...>
+
+	* string.c (rb_str_slice_bang): raise error when the string is frozen.
+
 Thu Mar  3 14:25:19 2011  NARUSE, Yui  <naruse@r...>
 
 	* strftime.c (STRFTIME): return 0 and ERANGE when precision is too
Index: string.c
===================================================================
--- string.c	(revision 31014)
+++ string.c	(revision 31015)
@@ -3503,9 +3503,9 @@
     for (i=0; i<argc; i++) {
 	buf[i] = argv[i];
     }
+    str_modify_keep_cr(str);
     result = rb_str_aref_m(argc, buf, str);
     if (!NIL_P(result)) {
-	str_modify_keep_cr(str);
 	buf[i] = rb_str_new(0,0);
 	rb_str_aset_m(argc+1, buf, str);
     }

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

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