1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-19 14:50:07 +03:00

fixed problem with dictionary handling within xmlParseInNodeContext (bug

* parser.c: fixed problem with dictionary handling within
  xmlParseInNodeContext (bug 153175)
This commit is contained in:
William M. Brack 2004-10-03 01:22:44 +00:00
parent cb40c222a4
commit c3f8134511
2 changed files with 19 additions and 5 deletions

View File

@ -1,3 +1,8 @@
Sat Oct 2 18:18:27 PDT 2004 William Brack <wbrack@mmm.com.hk>
* parser.c: fixed problem with dictionary handling within
xmlParseInNodeContext (bug 153175)
Sat Oct 2 15:46:37 PDT 2004 William Brack <wbrack@mmm.com.hk>
* check-relaxng-test-suite.py, check-relaxng-test-suite2.py,

View File

@ -10974,13 +10974,20 @@ xmlParseInNodeContext(xmlNodePtr node, const char *data, int datalen,
return(XML_ERR_NO_MEMORY);
}
xmlAddChild(node, fake);
xmlCtxtUseOptions(ctxt, options);
/*
* Use input doc's dict if present, else assure XML_PARSE_NODICT is set.
* We need a dictionary for xmlDetectSAX2, so if there's no doc dict
* we must wait until the last moment to free the original one.
*/
if (doc->dict != NULL) {
if (ctxt->dict != NULL)
if (ctxt->dict != NULL)
xmlDictFree(ctxt->dict);
ctxt->dict = doc->dict;
}
} else
options |= XML_PARSE_NODICT;
xmlCtxtUseOptions(ctxt, options);
xmlDetectSAX2(ctxt);
ctxt->myDoc = doc;
@ -11070,7 +11077,9 @@ xmlParseInNodeContext(xmlNodePtr node, const char *data, int datalen,
xmlFreeNodeList(*lst);
*lst = NULL;
}
if ((doc->dict == NULL) && (ctxt->dict != NULL))
xmlDictFree(ctxt->dict);
ctxt->dict = NULL;
xmlFreeParserCtxt(ctxt);