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

code cleanup, especially the function comments. fixed a small bug when

* DOCBparser.c HTMLparser.c c14n.c debugXML.c encoding.c hash.c
  nanoftp.c nanohttp.c parser.c parserInternals.c testC14N.c
  testDocbook.c threads.c tree.c valid.c xmlIO.c xmllint.c xmlmemory.c
  xmlreader.c xmlregexp.c xmlschemas.c xmlschemastypes.c xpath.c:
  code cleanup, especially the function comments.
* tree.c: fixed a small bug when freeing nodes which are XInclude ones.
Daniel
This commit is contained in:
Daniel Veillard
2002-12-10 15:19:08 +00:00
parent e1ca50330b
commit 01c13b5be2
24 changed files with 173 additions and 139 deletions

17
tree.c
View File

@ -2589,7 +2589,9 @@ xmlFreeNodeList(xmlNodePtr cur) {
if ((cur->children != NULL) &&
(cur->type != XML_ENTITY_REF_NODE))
xmlFreeNodeList(cur->children);
if ((cur->type == XML_ELEMENT_NODE) &&
if (((cur->type == XML_ELEMENT_NODE) ||
(cur->type == XML_XINCLUDE_START) ||
(cur->type == XML_XINCLUDE_END)) &&
(cur->properties != NULL))
xmlFreePropList(cur->properties);
if ((cur->type != XML_ELEMENT_NODE) &&
@ -2667,7 +2669,10 @@ xmlFreeNode(xmlNodePtr cur) {
if ((cur->children != NULL) &&
(cur->type != XML_ENTITY_REF_NODE))
xmlFreeNodeList(cur->children);
if ((cur->type == XML_ELEMENT_NODE) && (cur->properties != NULL))
if (((cur->type == XML_ELEMENT_NODE) ||
(cur->type == XML_XINCLUDE_START) ||
(cur->type == XML_XINCLUDE_END)) &&
(cur->properties != NULL))
xmlFreePropList(cur->properties);
if ((cur->type != XML_ELEMENT_NODE) &&
(cur->content != NULL) &&
@ -3407,7 +3412,7 @@ xmlCopyDoc(xmlDocPtr doc, int recursive) {
/**
* xmlGetLineNo:
* @node : valid node
* @node: valid node
*
* Get line number of node. this requires activation of this option
* before invoking the parser by calling xmlLineNumbersDefault(1)
@ -4695,7 +4700,7 @@ shadowed:
}
/**
* xmlNewReconciliedNs
* xmlNewReconciliedNs:
* @doc: the document
* @tree: a node expected to hold the new namespace
* @ns: the original namespace
@ -4761,7 +4766,7 @@ xmlNewReconciliedNs(xmlDocPtr doc, xmlNodePtr tree, xmlNsPtr ns) {
}
/**
* xmlReconciliateNs
* xmlReconciliateNs:
* @doc: the document
* @tree: a node defining the subtree to reconciliate
*
@ -7459,7 +7464,7 @@ xmlSaveFormatFileTo(xmlOutputBufferPtr buf, xmlDocPtr cur, const char *encoding,
}
/**
* xmlSaveFormatFileEnc
* xmlSaveFormatFileEnc:
* @filename: the filename or URL to output
* @cur: the document being saved
* @encoding: the name of the encoding to use or NULL.