소스 검색

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) {