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

ruby-changes:30409

From: kou <ko1@a...>
Date: Sat, 10 Aug 2013 12:48:36 +0900 (JST)
Subject: [ruby-changes:30409] kou:r42488 (trunk): * lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser):

kou	2013-08-10 12:48:30 +0900 (Sat, 10 Aug 2013)

  New Revision: 42488

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

  Log:
    * lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser):
      Fix wrong constant name. "]>" pattern match is the same but
      it is used for "<!DOCTYPE" end mark not "<![CDATA[" end mark.

  Modified files:
    trunk/ChangeLog
    trunk/lib/rexml/parsers/baseparser.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42487)
+++ ChangeLog	(revision 42488)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Aug 10 12:47:19 2013  Kouhei Sutou  <kou@c...>
+
+	* lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser):
+	  Fix wrong constant name. "]>" pattern match is the same but
+	  it is used for "<!DOCTYPE" end mark not "<![CDATA[" end mark.
+
 Sat Aug 10 12:43:15 2013  Kouhei Sutou  <kou@c...>
 
 	* lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser):
Index: lib/rexml/parsers/baseparser.rb
===================================================================
--- lib/rexml/parsers/baseparser.rb	(revision 42487)
+++ lib/rexml/parsers/baseparser.rb	(revision 42488)
@@ -43,6 +43,7 @@ module REXML https://github.com/ruby/ruby/blob/trunk/lib/rexml/parsers/baseparser.rb#L43
       REFERENCE_RE = /#{REFERENCE}/
 
       DOCTYPE_START = /\A\s*<!DOCTYPE\s/um
+      DOCTYPE_END = /\A\s*\]\s*>/um
       DOCTYPE_PATTERN = /\s*<!DOCTYPE\s+(.*?)(\[|>)/um
       ATTRIBUTE_PATTERN = /\s*(#{NAME_STR})\s*=\s*(["'])(.*?)\4/um
       COMMENT_START = /\A<!--/u
@@ -322,9 +323,9 @@ module REXML https://github.com/ruby/ruby/blob/trunk/lib/rexml/parsers/baseparser.rb#L323
               raise REXML::ParseException.new( "error parsing notation: no matching pattern", @source )
             end
             return [ :notationdecl, *vals ]
-          when CDATA_END
+          when DOCTYPE_END
             @document_status = :after_doctype
-            @source.match( CDATA_END, true )
+            @source.match( DOCTYPE_END, true )
             return [ :end_doctype ]
           end
         end

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

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