Permalink
Browse files

fixed bug #132575 about finding the end of the internal subset in push

* parser.c: fixed bug #132575 about finding the end of the
  internal subset in push mode.
* test/intsubset.xml result/intsubset.xml* result/noent/intsubset.xml:
  added the test to the regression suite
Daniel
  • Loading branch information...
1 parent 3671190 commit 036143bb535dd7829c3877d3c51f5d6e1298f07e Daniel Veillard committed Feb 12, 2004
Showing with 57 additions and 0 deletions.
  1. +7 −0 ChangeLog
  2. +23 −0 parser.c
  3. +5 −0 result/intsubset.xml
  4. +2 −0 result/intsubset.xml.rdr
  5. +9 −0 result/intsubset.xml.sax
  6. +5 −0 result/noent/intsubset.xml
  7. +6 −0 test/intsubset.xml
View
@@ -1,3 +1,10 @@
+Thu Feb 12 12:54:26 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * parser.c: fixed bug #132575 about finding the end of the
+ internal subset in push mode.
+ * test/intsubset.xml result/intsubset.xml* result/noent/intsubset.xml:
+ added the test to the regression suite
+
Wed Feb 11 14:19:31 CET 2004 Daniel Veillard <daniel@veillard.com>
* parserInternals.c xmlIO.c encoding.c include/libxml/parser.h
View
@@ -9477,6 +9477,29 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
quote = 0;
continue;
}
+ if ((quote == 0) && (buf[base] == '<')) {
+ int found = 0;
+ /* special handling of comments */
+ if (((unsigned int) base + 4 <
+ ctxt->input->buf->buffer->use) &&
+ (buf[base + 1] == '!') &&
+ (buf[base + 2] == '-') &&
+ (buf[base + 3] == '-')) {
+ for (;(unsigned int) base + 3 <
+ ctxt->input->buf->buffer->use; base++) {
+ if ((buf[base] == '-') &&
+ (buf[base + 1] == '-') &&
+ (buf[base + 2] == '>')) {
+ found = 1;
+ base += 2;
+ break;
+ }
+ }
+ if (!found)
+ break;
+ continue;
+ }
+ }
if (buf[base] == '"') {
quote = '"';
continue;
View
@@ -0,0 +1,5 @@
+<?xml version="1.0" standalone="yes"?>
+<!DOCTYPE root [
+<!ELEMENT root EMPTY>
+<!-- " -->]>
+<root/>
View
@@ -0,0 +1,2 @@
+0 10 root 0 0
+0 1 root 1 0
View
@@ -0,0 +1,9 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(root, , )
+SAX.elementDecl(root, 1, ...)
+SAX.comment( " )
+SAX.externalSubset(root, , )
+SAX.startElement(root)
+SAX.endElement(root)
+SAX.endDocument()
@@ -0,0 +1,5 @@
+<?xml version="1.0" standalone="yes"?>
+<!DOCTYPE root [
+<!ELEMENT root EMPTY>
+<!-- " -->]>
+<root/>
View
@@ -0,0 +1,6 @@
+<?xml version="1.0" standalone="yes"?>
+<!DOCTYPE root [
+<!ELEMENT root EMPTY>
+<!-- " -->
+]>
+<root/>

0 comments on commit 036143b

Please sign in to comment.