Browse Source

ccanlint: handle when _info doesn't compile.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Rusty Russell 13 years ago
parent
commit
02358a946a
2 changed files with 7 additions and 0 deletions
  1. 5 0
      tools/ccanlint/tests/depends_exist.c
  2. 2 0
      tools/depends.c

+ 5 - 0
tools/ccanlint/tests/depends_exist.c

@@ -57,6 +57,11 @@ static void check_depends_exist(struct manifest *m,
 		deps = get_deps(m, m->dir, "depends", true,
 				get_or_compile_info);
 
+	if (!deps) {
+		score->error = tal_fmt(m, "Could not extract dependencies");
+		return;
+	}
+
 	for (i = 0; deps[i]; i++) {
 		if (!strstarts(deps[i], "ccan/"))
 			continue;

+ 2 - 0
tools/depends.c

@@ -198,6 +198,8 @@ get_all_deps(const void *ctx, const char *dir, const char *style,
 	unsigned int i;
 
 	deps = get_one(ctx, dir, style, get_info);
+	if (!deps)
+		return NULL;
 	for (i = 0; i < tal_count(deps)-1; i++) {
 		char **newdeps;
 		unsigned int j;