Commit c3f81345 authored by William M. Brack's avatar William M. Brack
Browse files

fixed problem with dictionary handling within xmlParseInNodeContext (bug

* parser.c: fixed problem with dictionary handling within
  xmlParseInNodeContext (bug 153175)
parent cb40c222
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,
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment