X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fdepends_accurate.c;h=3ab6933ee7e4c57825d447ac771d9161a27b9500;hb=598b7d1351176b73247855893fd49c5e38f5800a;hp=a6d3a73a85dd94b6b4289f4c14dd1100b260f80b;hpb=016a19d260cd7f4afeb5b2b2cc28c8bbed1cd170;p=ccan diff --git a/tools/ccanlint/tests/depends_accurate.c b/tools/ccanlint/tests/depends_accurate.c index a6d3a73a..3ab6933e 100644 --- a/tools/ccanlint/tests/depends_accurate.c +++ b/tools/ccanlint/tests/depends_accurate.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -15,19 +16,6 @@ #include #include -static char *strip_spaces(const void *ctx, char *line) -{ - char *p = talloc_strdup(ctx, line); - unsigned int i, j; - - for (i = 0, j = 0; p[i]; i++) { - if (!isspace(p[i])) - p[j++] = p[i]; - } - p[j] = '\0'; - return p; -} - static bool has_dep(struct manifest *m, const char *depname) { struct manifest *i; @@ -60,22 +48,16 @@ static void check_depends_accurate(struct manifest *m, char **lines = get_ccan_file_lines(f); for (i = 0; lines[i]; i++) { - char *p; - if (lines[i][strspn(lines[i], " \t")] != '#') - continue; - p = strip_spaces(f, lines[i]); - if (!strstarts(p, "#includeerror = "Includes a ccan module" - " not listed in _info"; - score_file_error(score, f, i+1, lines[i]); + score_file_error(score, f, i+1, + "%s not listed in _info", + mod); } } }