From e815ffed022cfce3d003654f54a3a0b707807a9d Mon Sep 17 00:00:00 2001 From: dlichteblau Date: Sun, 27 Nov 2005 16:46:48 +0000 Subject: [PATCH] *patsch* wieder eine runde eof-bugs erschlagen --- XMLCONF | 9 ++------- xml/xml-parse.lisp | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/XMLCONF b/XMLCONF index d8925e4..33c08ae 100644 --- a/XMLCONF +++ b/XMLCONF @@ -113,12 +113,7 @@ xmltest/not-wf/sa/112.xml [not validating:] not-wf [validating:] invalid xmltest/not-wf/sa/113.xml [not validating:] not-wf [validating:] not-wf xmltest/not-wf/sa/114.xml [not validating:] not-wf [validating:] not-wf xmltest/not-wf/sa/115.xml [not validating:] not-wf [validating:] not-wf -xmltest/not-wf/sa/116.xml [not validating:] FAILED: - Argument Y is not a REAL: :EOF -[ - Internal general parsed entities are only well formed if - they match the "content" production. This is a partial - character reference, not a full one. ] +xmltest/not-wf/sa/116.xml [not validating:] not-wf [validating:] invalid xmltest/not-wf/sa/117.xml [not validating:] not-wf [validating:] invalid xmltest/not-wf/sa/118.xml [not validating:] not-wf [validating:] invalid xmltest/not-wf/sa/119.xml [not validating:] not-wf [validating:] invalid @@ -1886,4 +1881,4 @@ ibm/valid/P86/ibm86v01.xml [not validating:] input [validating:] input ibm/valid/P87/ibm87v01.xml [not validating:] input [validating:] input ibm/valid/P88/ibm88v01.xml [not validating:] input [validating:] input ibm/valid/P89/ibm89v01.xml [not validating:] input [validating:] input -21/1786 tests failed; 376 tests were skipped \ No newline at end of file +20/1786 tests failed; 376 tests were skipped \ No newline at end of file diff --git a/xml/xml-parse.lisp b/xml/xml-parse.lisp index b70328b..4e75f2d 100644 --- a/xml/xml-parse.lisp +++ b/xml/xml-parse.lisp @@ -1506,16 +1506,24 @@ (let ((c (read-rune input))) (check-rune input c #/#) (setq c (read-rune input)) - (cond ((eql c #/x) + (cond ((eql c :eof) + (eox input)) + ((eql c #/x) ;; hexadecimal (setq c (read-rune input)) + (when (eql c :eof) + (eox input)) (unless (digit-rune-p c 16) (wf-error "garbage in character reference")) (prog1 (parse-integer (with-output-to-string (sink) (write-char (rune-char c) sink) - (while (digit-rune-p (setq c (read-rune input)) 16) + (while (progn + (setq c (read-rune input)) + (when (eql c :eof) + (eox input)) + (digit-rune-p c 16)) (write-char (rune-char c) sink))) :radix 16) (check-rune input c #/\;))) @@ -1525,7 +1533,11 @@ (parse-integer (with-output-to-string (sink) (write-char (rune-char c) sink) - (while (rune<= #/0 (setq c (read-rune input)) #/9) + (while (progn + (setq c (read-rune input)) + (when (eql c :eof) + (eox input)) + (rune<= #/0 c #/9)) (write-char (rune-char c) sink))) :radix 10) (check-rune input c #/\;)))