From 02358a946a10fc2222b9966f3861cdc10a5550b8 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sat, 12 Jan 2013 16:04:58 +1030 Subject: [PATCH] ccanlint: handle when _info doesn't compile. Signed-off-by: Rusty Russell --- tools/ccanlint/tests/depends_exist.c | 5 +++++ tools/depends.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/tools/ccanlint/tests/depends_exist.c b/tools/ccanlint/tests/depends_exist.c index 39015fd5..f69a08e4 100644 --- a/tools/ccanlint/tests/depends_exist.c +++ b/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; diff --git a/tools/depends.c b/tools/depends.c index 399b0aad..a506c3d1 100644 --- a/tools/depends.c +++ b/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; -- 2.39.2