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

ruby-changes:19795

From: yugui <ko1@a...>
Date: Tue, 31 May 2011 09:13:10 +0900 (JST)
Subject: [ruby-changes:19795] yugui:r31840 (ruby_1_9_2): merges r31744 and r31745 from trunk into ruby_1_9_2.

yugui	2011-05-31 09:12:54 +0900 (Tue, 31 May 2011)

  New Revision: 31840

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

  Log:
    merges r31744 and r31745 from trunk into ruby_1_9_2.
    --
    prevent an error when passing a frozen string to REXML::Text.new
    
    dup the string passed in instead of cloning so that it's frozen state is ignored
    
    Signed-off-by: URABE, Shyouhei <shyouhei@r...>
    --
    ChangeLog for it

  Modified files:
    branches/ruby_1_9_2/ChangeLog
    branches/ruby_1_9_2/lib/rexml/text.rb
    branches/ruby_1_9_2/test/rexml/test_core.rb
    branches/ruby_1_9_2/version.h

Index: ruby_1_9_2/ChangeLog
===================================================================
--- ruby_1_9_2/ChangeLog	(revision 31839)
+++ ruby_1_9_2/ChangeLog	(revision 31840)
@@ -1,3 +1,11 @@
+Fri May 27 11:31:51 2011  misfo <tedwardo2@g...>
+
+	* lib/rexml/text.rb (REXML::Text#initialize): prevent an error
+	  when passing a frozen string to REXML::Text.new
+
+	  dup the string passed in instead of cloning so that it's frozen
+	  state is ignored
+
 Sun May 22 07:10:25 2011  Martin Bosslet  <Martin.Bosslet@g...>
 
 	* test/openssl/test_pkey_dsa.rb: Add tests for sign/verify.
Index: ruby_1_9_2/lib/rexml/text.rb
===================================================================
--- ruby_1_9_2/lib/rexml/text.rb	(revision 31839)
+++ ruby_1_9_2/lib/rexml/text.rb	(revision 31840)
@@ -105,7 +105,7 @@
       @normalized = @unnormalized = nil
 
       if arg.kind_of? String
-        @string = arg.clone
+        @string = arg.dup
         @string.squeeze!(" \n\t") unless respect_whitespace
       elsif arg.kind_of? Text
         @string = arg.to_s
Index: ruby_1_9_2/version.h
===================================================================
--- ruby_1_9_2/version.h	(revision 31839)
+++ ruby_1_9_2/version.h	(revision 31840)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 257
+#define RUBY_PATCHLEVEL 258
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 1
Index: ruby_1_9_2/test/rexml/test_core.rb
===================================================================
--- ruby_1_9_2/test/rexml/test_core.rb	(revision 31839)
+++ ruby_1_9_2/test/rexml/test_core.rb	(revision 31840)
@@ -371,6 +371,9 @@
     assert_equal(string, text.to_s)
     text2 = Text.new(text)
     assert_equal(text, text2)
+    string = "Frozen".freeze
+    text3 = Text.new(string)
+    assert_equal(string, text3.to_s)
     #testing substitution
     string = "0 < ( 1 & 1 )"
     correct = "0 &lt; ( 1 &amp; 1 )"

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

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