1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

Closing #3908 and #3937 and a memory leak in the SAX API

added SAX.h mostly useful for the doc generation
Regenerated all the docs,
Daniel
This commit is contained in:
Daniel Veillard
1999-12-03 13:19:09 +00:00
parent f5c2c8707a
commit 294cbca511
20 changed files with 1392 additions and 521 deletions

View File

@ -582,7 +582,7 @@ xmlNewInputFromFile(xmlParserCtxtPtr ctxt, const char *filename) {
inputStream->base = inputStream->buf->buffer->content;
inputStream->cur = inputStream->buf->buffer->content;
if ((ctxt->directory == NULL) && (directory != NULL))
ctxt->directory = directory;
ctxt->directory = (char *) xmlStrdup((const xmlChar *) directory);
return(inputStream);
}
@ -4441,7 +4441,11 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const xmlChar *ExternalID,
if ((CUR == '<') && (NXT(1) == '?') &&
(NXT(2) == 'x') && (NXT(3) == 'm') &&
(NXT(4) == 'l')) {
xmlParseTextDecl(ctxt);
xmlChar *decl;
decl = xmlParseTextDecl(ctxt);
if (decl != NULL)
xmlFree(decl);
}
if (ctxt->myDoc == NULL) {
ctxt->myDoc = xmlNewDoc(BAD_CAST "1.0");
@ -6662,6 +6666,8 @@ xmlSAXUserParseFile(xmlSAXHandlerPtr sax, void *user_data,
ctxt = xmlCreateFileParserCtxt(filename);
if (ctxt == NULL) return -1;
if (ctxt->sax != &xmlDefaultSAXHandler)
xmlFree(ctxt->sax);
ctxt->sax = sax;
ctxt->userData = user_data;