X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fhas_examples.c;h=d5f32795af44ef20da241b5f4b8453e52be0b35b;hp=12035e62f2fe3205b014263689692c0ca0d3a6dc;hb=b1801a00c945b67d8c218edd9e13dc483a60ac70;hpb=f9492529ffcc609036bb817561ee2a20546071ab diff --git a/tools/ccanlint/tests/has_examples.c b/tools/ccanlint/tests/has_examples.c index 12035e62..d5f32795 100644 --- a/tools/ccanlint/tests/has_examples.c +++ b/tools/ccanlint/tests/has_examples.c @@ -25,12 +25,14 @@ static char *add_example(struct manifest *m, struct ccan_file *source, struct ccan_file *f; name = maybe_temp_file(m, ".c", keep, - talloc_asprintf(m, "example-%s-%s", + talloc_asprintf(m, "%s/example-%s-%s.c", + talloc_dirname(m, + source->fullname), source->name, example->function)); f = new_ccan_file(m, talloc_dirname(m, name), talloc_basename(m, name)); talloc_steal(f, name); - list_add(&m->examples, &f->list); + list_add_tail(&m->examples, &f->list); fd = open(f->fullname, O_WRONLY | O_CREAT | O_EXCL, 0600); if (fd < 0) @@ -68,7 +70,7 @@ static void *extract_examples(struct manifest *m, list_for_each(get_ccan_file_docs(m->info_file), d, list) { if (streq(d->type, "example")) { - score->error = add_example(m, m->info_file, keep, d);; + score->error = add_example(m, m->info_file, keep, d); if (score->error) return score; score->info_example = true;