emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r99908: * xml.el (xml-parse-region


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r99908: * xml.el (xml-parse-region): Avoid infloop (Bug#5281).
Date: Wed, 30 Jun 2010 16:34:06 -0400
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 99908
committer: Chong Yidong <address@hidden>
branch nick: emacs-23
timestamp: Wed 2010-06-30 16:34:06 -0400
message:
  * xml.el (xml-parse-region): Avoid infloop (Bug#5281).
modified:
  lisp/ChangeLog
  lisp/xml.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-06-29 20:41:04 +0000
+++ b/lisp/ChangeLog    2010-06-30 20:34:06 +0000
@@ -1,3 +1,7 @@
+2010-06-30  Chong Yidong  <address@hidden>
+
+       * xml.el (xml-parse-region): Avoid infloop (Bug#5281).
+
 2010-06-29  Leo  <address@hidden>
 
        * emacs-lisp/rx.el (rx): Doc fix.  (Bug#6537)

=== modified file 'lisp/xml.el'
--- a/lisp/xml.el       2010-01-13 08:35:10 +0000
+++ b/lisp/xml.el       2010-06-30 20:34:06 +0000
@@ -321,18 +321,20 @@
                (progn
                  (forward-char -1)
                  (setq result (xml-parse-tag parse-dtd parse-ns))
-                 (if (and xml result (not xml-sub-parser))
-                     ;;  translation of rule [1] of XML specifications
-                     (error "XML: (Not Well-Formed) Only one root tag allowed")
-                   (cond
-                    ((null result))
-                    ((and (listp (car result))
-                          parse-dtd)
-                     (setq dtd (car result))
-                     (if (cdr result)  ; possible leading comment
-                         (add-to-list 'xml (cdr result))))
-                    (t
-                     (add-to-list 'xml result)))))
+                 (cond
+                  ((null result)
+                   ;; Not looking at an xml start tag.
+                   (forward-char 1))
+                  ((and xml (not xml-sub-parser))
+                   ;; Translation of rule [1] of XML specifications
+                   (error "XML: (Not Well-Formed) Only one root tag allowed"))
+                  ((and (listp (car result))
+                        parse-dtd)
+                   (setq dtd (car result))
+                   (if (cdr result)    ; possible leading comment
+                       (add-to-list 'xml (cdr result))))
+                  (t
+                   (add-to-list 'xml result))))
              (goto-char (point-max))))
          (if parse-dtd
              (cons dtd (nreverse xml))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]