X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ffile_analysis.c;h=530416e368cb1fd17a48f93fa7c9bc220b0f1a20;hp=92c23798292c9844058374f22115b324345ae720;hb=3b200f895cb7884c72d9e2409f047284027abc68;hpb=02bdd9ac60b7edd2056fd52735b977b515c9b961 diff --git a/tools/ccanlint/file_analysis.c b/tools/ccanlint/file_analysis.c index 92c23798..530416e3 100644 --- a/tools/ccanlint/file_analysis.c +++ b/tools/ccanlint/file_analysis.c @@ -253,16 +253,17 @@ struct manifest *get_manifest(const void *ctx, const char *dir) /* We expect the ccan dir to be two levels above module dir. */ if (!ccan_dir) { - char *p; - ccan_dir = talloc_strdup(NULL, m->dir); - p = strrchr(ccan_dir, '/'); + char *p, *dir; + dir = talloc_strdup(NULL, m->dir); + p = strrchr(dir, '/'); if (!p) errx(1, "I expect the ccan root directory in ../.."); *p = '\0'; - p = strrchr(ccan_dir, '/'); + p = strrchr(dir, '/'); if (!p) errx(1, "I expect the ccan root directory in ../.."); *p = '\0'; + ccan_dir = dir; } add_files(m, ""); @@ -361,7 +362,7 @@ bool get_token(const char **line, const char *token) unsigned int toklen; *line += strspn(*line, " \t"); - if (isalnum(token[0]) || token[0] == '_') + if (cisalnum(token[0]) || token[0] == '_') toklen = strspn(*line, IDENT_CHARS); else { /* FIXME: real tokenizer handles ++ and other multi-chars. */