From: Rusty Russell Date: Sat, 12 Jan 2013 05:34:58 +0000 (+1030) Subject: ccanlint: handle when _info doesn't compile. X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=02358a946a10fc2222b9966f3861cdc10a5550b8;hp=d61a0d6c2c9d2b385075338665d64ae1d1bbe3dc ccanlint: handle when _info doesn't compile. Signed-off-by: Rusty Russell --- 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;