mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
Small fixes: - xpath.c: fixed a memleak when comparing nodesets -
Small fixes: - xpath.c: fixed a memleak when comparing nodesets - HTMLtree.c: don't invent the HTML doctype if not available (XSLT) - tree.c: added a TODO Daniel
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
Mon Apr 2 17:13:51 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
||||||
|
|
||||||
|
* xpath.c: fixed a memleak when comparing nodesets
|
||||||
|
* HTMLtree.c: don't invent the HTML doctype if not available (XSLT)
|
||||||
|
* tree.c: added a TODO
|
||||||
|
|
||||||
Tue Mar 27 14:32:06 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
Tue Mar 27 14:32:06 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
||||||
|
|
||||||
* configure.in Makefile.am config.h.in xmlversion.h.in: detect if
|
* configure.in Makefile.am config.h.in xmlversion.h.in: detect if
|
||||||
|
10
HTMLtree.c
10
HTMLtree.c
@ -961,12 +961,15 @@ htmlDocContentDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr cur, const char *enco
|
|||||||
*/
|
*/
|
||||||
type = cur->type;
|
type = cur->type;
|
||||||
cur->type = XML_HTML_DOCUMENT_NODE;
|
cur->type = XML_HTML_DOCUMENT_NODE;
|
||||||
if (cur->intSubset != NULL)
|
if (cur->intSubset != NULL) {
|
||||||
htmlDtdDumpOutput(buf, cur, NULL);
|
htmlDtdDumpOutput(buf, cur, NULL);
|
||||||
else {
|
#if 0
|
||||||
|
/* Disabled for XSLT output */
|
||||||
|
} else {
|
||||||
/* Default to HTML-4.0 transitionnal @@@@ */
|
/* Default to HTML-4.0 transitionnal @@@@ */
|
||||||
xmlOutputBufferWriteString(buf, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">\n");
|
xmlOutputBufferWriteString(buf, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">\n");
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (cur->children != NULL) {
|
if (cur->children != NULL) {
|
||||||
htmlNodeListDumpOutput(buf, cur, cur->children, encoding);
|
htmlNodeListDumpOutput(buf, cur, cur->children, encoding);
|
||||||
@ -975,7 +978,6 @@ htmlDocContentDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr cur, const char *enco
|
|||||||
cur->type = (xmlElementType) type;
|
cur->type = (xmlElementType) type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* *
|
* *
|
||||||
* Saving functions front-ends *
|
* Saving functions front-ends *
|
||||||
@ -1130,6 +1132,8 @@ htmlSaveFileEnc(const char *filename, xmlDocPtr cur, const char *encoding) {
|
|||||||
return(-1);
|
return(-1);
|
||||||
htmlSetMetaEncoding(cur, (const xmlChar *) encoding);
|
htmlSetMetaEncoding(cur, (const xmlChar *) encoding);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
htmlSetMetaEncoding(cur, (const xmlChar *) "UTF-8");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
4
tree.c
4
tree.c
@ -645,6 +645,10 @@ xmlStringGetNodeList(xmlDocPtr doc, const xmlChar *value) {
|
|||||||
|
|
||||||
q = cur;
|
q = cur;
|
||||||
while (*cur != 0) {
|
while (*cur != 0) {
|
||||||
|
/* TODO: attributes can inherits & ...
|
||||||
|
if ((*cur == '&') && (cur[1] == '#')) {
|
||||||
|
int val =
|
||||||
|
} else */
|
||||||
if (*cur == '&') {
|
if (*cur == '&') {
|
||||||
/*
|
/*
|
||||||
* Save the current text.
|
* Save the current text.
|
||||||
|
23
xpath.c
23
xpath.c
@ -2541,22 +2541,35 @@ xmlXPathCompareNodeSets(int inf, int strict,
|
|||||||
xmlNodeSetPtr ns2;
|
xmlNodeSetPtr ns2;
|
||||||
|
|
||||||
if ((arg1 == NULL) ||
|
if ((arg1 == NULL) ||
|
||||||
((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)))
|
((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE))) {
|
||||||
|
xmlXPathFreeObject(arg2);
|
||||||
return(0);
|
return(0);
|
||||||
|
}
|
||||||
if ((arg2 == NULL) ||
|
if ((arg2 == NULL) ||
|
||||||
((arg2->type != XPATH_NODESET) && (arg2->type != XPATH_XSLT_TREE)))
|
((arg2->type != XPATH_NODESET) && (arg2->type != XPATH_XSLT_TREE))) {
|
||||||
|
xmlXPathFreeObject(arg1);
|
||||||
|
xmlXPathFreeObject(arg2);
|
||||||
return(0);
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
ns1 = arg1->nodesetval;
|
ns1 = arg1->nodesetval;
|
||||||
ns2 = arg2->nodesetval;
|
ns2 = arg2->nodesetval;
|
||||||
|
|
||||||
if (ns1->nodeNr <= 0)
|
if (ns1->nodeNr <= 0) {
|
||||||
|
xmlXPathFreeObject(arg1);
|
||||||
|
xmlXPathFreeObject(arg2);
|
||||||
return(0);
|
return(0);
|
||||||
if (ns2->nodeNr <= 0)
|
}
|
||||||
|
if (ns2->nodeNr <= 0) {
|
||||||
|
xmlXPathFreeObject(arg1);
|
||||||
|
xmlXPathFreeObject(arg2);
|
||||||
return(0);
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
values2 = (double *) xmlMalloc(ns2->nodeNr * sizeof(double));
|
values2 = (double *) xmlMalloc(ns2->nodeNr * sizeof(double));
|
||||||
if (values2 == NULL) {
|
if (values2 == NULL) {
|
||||||
|
xmlXPathFreeObject(arg1);
|
||||||
|
xmlXPathFreeObject(arg2);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
for (i = 0;i < ns1->nodeNr;i++) {
|
for (i = 0;i < ns1->nodeNr;i++) {
|
||||||
@ -2595,6 +2608,8 @@ xmlXPathCompareNodeSets(int inf, int strict,
|
|||||||
init = 1;
|
init = 1;
|
||||||
}
|
}
|
||||||
xmlFree(values2);
|
xmlFree(values2);
|
||||||
|
xmlXPathFreeObject(arg1);
|
||||||
|
xmlXPathFreeObject(arg2);
|
||||||
return(ret);
|
return(ret);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user