From a1d23eb50565fe149ef2daf4c8404029a9ecaa74 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 13 Feb 2013 15:24:11 +0800 Subject: [PATCH] * xml.el (xml-parse-string): Fix typo in handling of bad character references. --- lisp/ChangeLog | 5 +++++ lisp/xml.el | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 580f9ea26be..5a80702af0d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-02-13 Chong Yidong + + * xml.el (xml-parse-string): Fix typo in handling of bad character + references. + 2013-02-10 Michael Albinus * net/ange-ftp.el (ange-ftp-make-directory): Don't raise an error, 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 -- 2.11.4.GIT