浏览代码

XML backend: fix assertion tests

Both name and help can be NULL if the underlying XML
backend says so (i.e. it fails to find the corresponding
attribute). We shall not test the first character of the
attribute but its existence.

This patch reverts a forgotten change that comes from
the first implementation of the XML backends.
Emmanuel Deloget 12 年之前
父节点
当前提交
9f4ba3e5f5
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      clish/shell/shell_xml.c

+ 2 - 2
clish/shell/shell_xml.c

@@ -266,7 +266,7 @@ process_command(clish_shell_t * shell, clish_xmlnode_t * element, void *parent)
 	if (!allowed)
 		goto process_command_end;
 
-	assert(*name);
+	assert(name);
 
 	/* check this command doesn't already exist */
 	old = clish_view_find_command(v, name, BOOL_FALSE);
@@ -277,7 +277,7 @@ process_command(clish_shell_t * shell, clish_xmlnode_t * element, void *parent)
 		goto process_command_end;
 	}
 
-	assert(*help);
+	assert(help);
 
 	/* Reference 'ref' field */
 	if (ref) {