tried to fix bug #91500 where doc->children may be overriden by a call to

* parser.c: tried to fix bug #91500 where doc->children may
  be overriden by a call to xmlParseBalancedChunkMemory()
* catalog.c: tried to fix bug #90945 w.r.t. parsing of system
  identifiers in SGML catalogs containing '&'
Daniel
diff --git a/ChangeLog b/ChangeLog
index 2ea21a2..2c9f802 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Mon Oct 21 09:57:10 CEST 2002 Daniel Veillard <daniel@veillard.com>
+
+	* parser.c: tried to fix bug #91500 where doc->children may
+	  be overriden by a call to xmlParseBalancedChunkMemory()
+
+Mon Oct 21 09:04:32 CEST 2002 Daniel Veillard <daniel@veillard.com>
+
+	* catalog.c: tried to fix bug #90945 w.r.t. parsing of system
+	  identifiers in SGML catalogs containing '&'
+
 Sun Oct 20 23:31:47 CEST 2002 Daniel Veillard <daniel@veillard.com>
 
 	* python/types.c: fixed bugs when passing result value tree
diff --git a/catalog.c b/catalog.c
index a548c03..8905b04 100644
--- a/catalog.c
+++ b/catalog.c
@@ -1954,7 +1954,7 @@
 		"malloc of %d byte failed\n", size);
 	return(NULL);
     }
-    while (xmlIsPubidChar(*cur)) {
+    while (xmlIsPubidChar(*cur) || (*cur == '?')) {
 	if ((*cur == stop) && (stop != ' '))
 	    break;
 	if ((stop == ' ') && (IS_BLANK(*cur)))
diff --git a/parser.c b/parser.c
index f734a3c..a10b3e3 100644
--- a/parser.c
+++ b/parser.c
@@ -9784,6 +9784,7 @@
     xmlParserCtxtPtr ctxt;
     xmlDocPtr newDoc;
     xmlSAXHandlerPtr oldsax = NULL;
+    xmlNodePtr content;
     int size;
     int ret = 0;
 
@@ -9843,7 +9844,10 @@
     ctxt->validate = 0;
     ctxt->loadsubset = 0;
 
+    content = doc->children;
+    doc->children = NULL;
     xmlParseContent(ctxt);
+    doc->children = content;
    
     if ((RAW == '<') && (NXT(1) == '/')) {
 	ctxt->errNo = XML_ERR_NOT_WELL_BALANCED;