]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/depends_accurate.c
ccanlint: handle nested modules when mentioned in examples.
[ccan] / tools / ccanlint / tests / depends_accurate.c
index 2a47d0eb97fc7f3ded74a6ef01e676a1cd8fae75..05ada48a40dc8b829c361beca5ba9d17350abc6c 100644 (file)
@@ -22,7 +22,7 @@ static bool has_dep(struct manifest *m, char **deps, bool *used,
        unsigned int i;
 
        /* We can include ourselves, of course. */
-       if (streq(depname + strlen("ccan/"), m->basename))
+       if (streq(depname + strlen("ccan/"), m->modname))
                return true;
 
        for (i = 0; deps[i]; i++) {
@@ -48,7 +48,7 @@ static bool check_dep_includes(struct manifest *m,
                char *mod;
                if (!strreg(f, lines[i],
                            "^[ \t]*#[ \t]*include[ \t]*[<\"]"
-                           "(ccan/+[^/]+)/", &mod))
+                           "(ccan/+.+)/+[^/]+\\.h", &mod))
                        continue;
 
                if (has_dep(m, deps, used, mod))