summaryrefslogtreecommitdiff
path: root/lisp/xml.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@gnu.org>2012-04-21 17:53:37 +0800
committerChong Yidong <cyd@gnu.org>2012-04-21 17:53:37 +0800
commit18edb22d4f484783b009d3b4420f62462025f350 (patch)
treefbbcc20b8aeeb7aa2cce6db199a91ea7153ba1e7 /lisp/xml.el
parent7b9946cfd9ce13a9435857422303fd2ce7957800 (diff)
downloademacs-18edb22d4f484783b009d3b4420f62462025f350.tar.gz
Fix xml.el regression introduced by 2012-01-27 change.
* lisp/xml.el (xml-parse-region, xml-parse-tag): Avoid errors due to reaching eob. Fixes: debbugs:11286
Diffstat (limited to 'lisp/xml.el')
-rw-r--r--lisp/xml.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/xml.el b/lisp/xml.el
index 39a8da0f337..cb56f023af0 100644
--- a/lisp/xml.el
+++ b/lisp/xml.el
@@ -323,7 +323,8 @@ If PARSE-NS is non-nil, then QNAMES are expanded."
(cond
((null result)
;; Not looking at an xml start tag.
- (forward-char 1))
+ (unless (eobp)
+ (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"))
@@ -422,7 +423,8 @@ Returns one of:
((looking-at "<!--")
(search-forward "-->")
(skip-syntax-forward " ")
- (xml-parse-tag parse-dtd xml-ns))
+ (unless (eobp)
+ (xml-parse-tag parse-dtd xml-ns)))
;; end tag
((looking-at "</")
'())