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

ruby-changes:8647

From: yugui <ko1@a...>
Date: Tue, 11 Nov 2008 17:41:14 +0900 (JST)
Subject: [ruby-changes:8647] Ruby:r20182 (ruby_1_9_1): merges r20120 from trunk into ruby_1_9_1.

yugui	2008-11-11 17:40:57 +0900 (Tue, 11 Nov 2008)

  New Revision: 20182

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

  Log:
    merges r20120 from trunk into ruby_1_9_1.
    * lib/rexml/entity.rb (unnormalized): do not call
      document.record_entity_expansion if document is nil.
      see <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=502535>.
      Thanks, Naohisa Goto.
    * test/rexml/test_document.rb: ditto.

  Modified files:
    branches/ruby_1_9_1/ChangeLog
    branches/ruby_1_9_1/lib/rexml/entity.rb
    branches/ruby_1_9_1/test/rexml/test_document.rb

Index: ruby_1_9_1/ChangeLog
===================================================================
--- ruby_1_9_1/ChangeLog	(revision 20181)
+++ ruby_1_9_1/ChangeLog	(revision 20182)
@@ -1,3 +1,12 @@
+Fri Nov  7 02:00:12 2008  Shugo Maeda  <shugo@r...>
+
+	* lib/rexml/entity.rb (unnormalized): do not call
+	  document.record_entity_expansion if document is nil.
+	  see <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=502535>.
+	  Thanks, Naohisa Goto.
+
+	* test/rexml/test_document.rb: ditto.
+
 Fri Nov  7 01:24:20 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* tool/make-snapshot: binary encoding spec is no longer needed in 1.9.
Index: ruby_1_9_1/lib/rexml/entity.rb
===================================================================
--- ruby_1_9_1/lib/rexml/entity.rb	(revision 20181)
+++ ruby_1_9_1/lib/rexml/entity.rb	(revision 20182)
@@ -73,7 +73,7 @@
     # all entities -- both %ent; and &ent; entities.  This differs from
     # +value()+ in that +value+ only replaces %ent; entities.
     def unnormalized
-      document.record_entity_expansion
+      document.record_entity_expansion unless document.nil?
       v = value()
       return nil if v.nil?
       @unnormalized = Text::unnormalize(v, parent)
Index: ruby_1_9_1/test/rexml/test_document.rb
===================================================================
--- ruby_1_9_1/test/rexml/test_document.rb	(revision 20181)
+++ ruby_1_9_1/test/rexml/test_document.rb	(revision 20182)
@@ -35,6 +35,7 @@
 <member>
 &a;
 &a2;
+&lt;
 </member>
 EOF
 
@@ -53,7 +54,7 @@
 
     REXML::Document.entity_expansion_limit = 4
     doc = REXML::Document.new(XML_WITH_4_ENTITY_EXPANSION)
-    assert_equal("\na\na a\n", doc.root.children.first.value)
+    assert_equal("\na\na a\n<\n", doc.root.children.first.value)
     REXML::Document.entity_expansion_limit = 3
     doc = REXML::Document.new(XML_WITH_4_ENTITY_EXPANSION)
     assert_raise(RuntimeError) do

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

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