summaryrefslogtreecommitdiff
path: root/lisp/xml.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2016-03-11 13:32:13 -0800
committerJohn Wiegley <johnw@newartisans.com>2016-03-11 13:32:13 -0800
commita934bf445ffaa7920aa1dfea47fe08920bbbc94c (patch)
treedae27dd7ebeb733768ac5091c1c4d6b4749689e1 /lisp/xml.el
parentb7ad5db04ba068ac9cbcfb9a02291e957d093a32 (diff)
parent620951fe22a6ecc2edc1f78d961f52566a7fe2b6 (diff)
downloademacs-a934bf445ffaa7920aa1dfea47fe08920bbbc94c.tar.gz
emacs-a934bf445ffaa7920aa1dfea47fe08920bbbc94c.tar.bz2
emacs-a934bf445ffaa7920aa1dfea47fe08920bbbc94c.zip
Merge from origin/emacs-25
620951f Fix previous fix of enlarge-/shrink-window 2e78353 * lisp/isearch.el (isearch-define-mode-toggle): Fix toggling logic 66d2717 Complete temperature units in calc-convert-temperature dbb02bf Make sure to use case-sensitive search 8b01e69 Prevent infinite loop on not-well-formed xml. (Bug#16344) 100346a Add the missing test case for the previous patch 5aba61e Use the correct dabbrev expansion
Diffstat (limited to 'lisp/xml.el')
-rw-r--r--lisp/xml.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/xml.el b/lisp/xml.el
index 2c3b6a49f61..1802d04dfaf 100644
--- a/lisp/xml.el
+++ b/lisp/xml.el
@@ -579,7 +579,14 @@ Return one of:
(error "XML: (Well-Formed) Invalid character"))
;; However, if we're parsing incrementally, then we need to deal
;; with stray CDATA.
- (xml-parse-string)))))
+ (let ((s (xml-parse-string)))
+ (when (string-empty-p s)
+ ;; We haven't consumed any input! We must throw an error in
+ ;; order to prevent looping forever.
+ (error "XML: (Not Well-Formed) Could not parse: %s"
+ (buffer-substring-no-properties
+ (point) (min (+ (point) 10) (point-max)))))
+ s)))))
(defun xml-parse-string ()
"Parse character data at point, and return it as a string.