[svn-commits] eliel: branch group/appdocsxml r151015 - /team/group/appdocsxml/main/pbx.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Oct 18 11:36:39 CDT 2008


Author: eliel
Date: Sat Oct 18 11:36:39 2008
New Revision: 151015

URL: http://svn.digium.com/view/asterisk?view=rev&rev=151015
Log:
Fix a not being closed xml_doc on memory allocation error.
Add more documentation.

Modified:
    team/group/appdocsxml/main/pbx.c

Modified: team/group/appdocsxml/main/pbx.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/main/pbx.c?view=diff&rev=151015&r1=151014&r2=151015
==============================================================================
--- team/group/appdocsxml/main/pbx.c (original)
+++ team/group/appdocsxml/main/pbx.c Sat Oct 18 11:36:39 2008
@@ -3463,7 +3463,7 @@
 
 	AST_LIST_LOCK(&xmldoc_tree);
 	AST_LIST_TRAVERSE(&xmldoc_tree, doctree, entry) {
-
+		/* the core xml documents have priority over thirdparty document. */
 		node = ast_xml_get_root(doctree->doc);
 		node = node->AST_XML_CHILD;
 		while (node) {
@@ -3549,6 +3549,7 @@
 }
 
 /*! \internal
+ *  \brief Check if the passed node has <argument> tags inside it.
  *  \param node Root node to search argument elements.
  *  \retval 1 If a <argument> element is found inside 'node'.
  *  \retval 0 If no <argument> is found inside 'node'.
@@ -4065,6 +4066,7 @@
 		return ret;
 	}
 
+	/* use this spacing (add 4 spaces) inside a variablelist node. */
 	ast_asprintf(&vartabs, "%s    ", tabs);
 
 	tmp = node->AST_XML_CHILD;
@@ -4099,7 +4101,7 @@
 }
 
 /*! \internal
- *  \brief Parse the <see-also> node.
+ *  \brief Parse the <see-also> node content.
  *  \param type 'application' or 'function'.
  *  \param name Application or functions name.
  *  \retval NULL on error.
@@ -4271,6 +4273,7 @@
 	node = node->AST_XML_CHILD;
 	while (node) {
 		if (!strcasecmp((char *)node->AST_XML_NAME, "argument")) {
+			/* if this is the first data appended to buffer, print a \n*/
 			if (!ret && node->AST_XML_CHILD) {
 				/* print \n */
 				ast_str_append(buffer, 0, "\n");
@@ -4328,7 +4331,7 @@
 		optname = ast_xml_get_attribute(node, "name");
 		if (!optname) {
 			node = node->AST_XML_NEXT;
-			continue;	
+			continue;
 		}
 
 		optionsyntax = xmldoc_build_syntax(node, optname, "argument", 0, 1);
@@ -6408,6 +6411,7 @@
 		doc_tree = ast_calloc(1, sizeof(*doc_tree));
 		if (!doc_tree) {
 			ast_log(LOG_ERROR, "Unable to allocate documentation_tree structure!\n");
+			ast_xml_close(tmpdoc);
 			continue;
 		}
 		doc_tree->doc = tmpdoc;




More information about the svn-commits mailing list