X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Flicenses.c;h=45684974f528a506ef2a7be9b09db2ea877ce434;hp=ff786de88c70f201f17110ac83df342bc063c210;hb=79ac0049672b1f27b1a7121d06cc38721f76b8e1;hpb=4fc1f40b58ec470a89d95e8790956a4967a87cb1 diff --git a/tools/ccanlint/licenses.c b/tools/ccanlint/licenses.c index ff786de8..45684974 100644 --- a/tools/ccanlint/licenses.c +++ b/tools/ccanlint/licenses.c @@ -1,8 +1,8 @@ #include "licenses.h" #include "ccanlint.h" -#include #include -#include +#include +#include const struct license_info licenses[] = { { "LGPLv2+", "LGPL", @@ -155,9 +155,10 @@ enum license which_license(struct doc_section *d) return LICENSE_BSD; if (streq(d->lines[0], "CC0")) return LICENSE_CC0; - if (strreg(NULL, d->lines[0], "CC0 \\([Pp]ublic [Dd]omain\\)", NULL)) + if (tal_strreg(NULL, d->lines[0], "CC0 \\([Pp]ublic [Dd]omain\\)", + NULL)) return LICENSE_CC0; - if (strreg(NULL, d->lines[0], "[Pp]ublic [Dd]omain")) + if (tal_strreg(NULL, d->lines[0], "[Pp]ublic [Dd]omain")) return LICENSE_PUBLIC_DOMAIN; return LICENSE_UNKNOWN; @@ -169,7 +170,7 @@ const char *get_ccan_simplified(struct ccan_file *f) unsigned int i, j; /* Simplify for easy matching: only alnum and single spaces. */ - f->simplified = talloc_strdup(f, get_ccan_file_contents(f)); + f->simplified = tal_strdup(f, get_ccan_file_contents(f)); for (i = 0, j = 0; f->simplified[i]; i++) { if (cisupper(f->simplified[i])) f->simplified[j++] = tolower(f->simplified[i]); @@ -208,7 +209,7 @@ struct doc_section *find_license_tag(const struct manifest *m) struct doc_section *d; list_for_each(get_ccan_file_docs(m->info_file), d, list) { - if (!streq(d->function, m->basename)) + if (!streq(d->function, m->modname)) continue; if (streq(d->type, "license")) return d;