summaryrefslogtreecommitdiff
path: root/lisp/xml.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@gnu.org>2013-02-13 15:24:11 +0800
committerChong Yidong <cyd@gnu.org>2013-02-13 15:24:11 +0800
commita1d23eb50565fe149ef2daf4c8404029a9ecaa74 (patch)
tree20c62eab90e814f46b3d3915fdb7ad50328f2454 /lisp/xml.el
parent1a359750bbac95fd6bf8fe1233e747a1d26f0082 (diff)
downloademacs-a1d23eb50565fe149ef2daf4c8404029a9ecaa74.tar.gz
* xml.el (xml-parse-string): Fix typo in handling of bad character references.
Diffstat (limited to 'lisp/xml.el')
-rw-r--r--lisp/xml.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/xml.el b/lisp/xml.el
index 2232746f02a..a3d34670bfb 100644
--- a/lisp/xml.el
+++ b/lisp/xml.el
@@ -611,7 +611,7 @@ references."
xml-validating-parser
(error "XML: (Validity) Invalid character reference `%s'"
(match-string 0)))
- (replace-match (or (string val) xml-undefined-entity) t t))
+ (replace-match (if val (string val) xml-undefined-entity) t t))
;; For an entity reference, search again from the start of
;; the replaced text, since the replacement can contain
;; entity or character references, or markup.
@@ -620,7 +620,7 @@ references."
(and (null val)
xml-validating-parser
(error "XML: (Validity) Undefined entity `%s'" ref))
- (replace-match (cdr val) t t)
+ (replace-match (or (cdr val) xml-undefined-entity) t t)
(goto-char (match-beginning 0)))
;; Check for XML bombs.
(and xml-entity-expansion-limit