[asterisk-commits] mvanbaak: branch group/appdocsxml r137278 - /team/group/appdocsxml/main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 11 17:24:51 CDT 2008


Author: mvanbaak
Date: Mon Aug 11 17:24:51 2008
New Revision: 137278

URL: http://svn.digium.com/view/asterisk?view=rev&rev=137278
Log:
synopsis is now working without the <para> tag

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=137278&r1=137277&r2=137278
==============================================================================
--- team/group/appdocsxml/main/pbx.c (original)
+++ team/group/appdocsxml/main/pbx.c Mon Aug 11 17:24:51 2008
@@ -3218,20 +3218,22 @@
 		return NULL;
 	}
 
-	tmp = node->AST_XML_CHILD;
-	while (tmp) {
-		/* if found, parse a <para> element. */
-		if (ast_xml_doc_parse_para(tmp, "", "\n", &len, &ret)) {
+	if (!strcasecmp((char *)node->name, "synopsis")) {
+		ret = ast_xml_get_text(node);
+	} else {
+		tmp = node->AST_XML_CHILD;
+		while (tmp) {
+			/* if found, parse a <para> element. */
+			if (ast_xml_doc_parse_para(tmp, "", "\n", &len, &ret)) {
+				tmp = tmp->AST_XML_NEXT;
+				continue;
+			}
+			/* if found, parse a <variablelist> element. */
+			ast_xml_doc_parse_variablelist(tmp, "\n", &len, &ret);
+			
 			tmp = tmp->AST_XML_NEXT;
-			continue;
-		}
-		
-		/* if found, parse a <variablelist> element. */
-		ast_xml_doc_parse_variablelist(tmp, "\n", &len, &ret);
-		
-		tmp = tmp->AST_XML_NEXT;
-	}
-	
+		}
+	}
 	return ret;
 }
 
@@ -3267,7 +3269,7 @@
 	node = ast_xml_find_element(node->AST_XML_CHILD, var, NULL, NULL);
 
 	if (!node || !node->AST_XML_CHILD) {
-		ast_log(LOG_DEBUG, "Cannot find varible '%s' in tree '%s'\n", name, var);
+		ast_log(LOG_DEBUG, "Cannot find variable '%s' in tree '%s'\n", name, var);
 		return NULL;
 	}
 




More information about the asterisk-commits mailing list