]> git.ozlabs.org Git - ccan/commitdiff
ccanlint: handle -x correctly with multiple modules.
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 19 Mar 2012 05:14:59 +0000 (15:44 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 19 Mar 2012 05:14:59 +0000 (15:44 +1030)
After the first module we were resetting even the excluded tests, which caused
a segfault as they weren't initialized.

tools/ccanlint/ccanlint.c

index 8c6ee1e4080410075a408efc1621041ab7637fb3..516c5bb6cbe062e43d23e910989f69c077161155 100644 (file)
@@ -689,7 +689,9 @@ static bool run_tests(struct dgraph_node *all,
 static bool add_to_all(const char *member, struct ccanlint *c,
                       struct dgraph_node *all)
 {
-       dgraph_add_edge(&c->node, all);
+       /* If we're excluded on cmdline, don't add. */
+       if (!c->skip)
+               dgraph_add_edge(&c->node, all);
        return true;
 }