]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/has_examples.c
ccanlint: add somefunc() to help examples compile.
[ccan] / tools / ccanlint / tests / has_examples.c
index 12035e62f2fe3205b014263689692c0ca0d3a6dc..22d18e9d5a1440004c341d2bde93f3b735707a7b 100644 (file)
@@ -25,7 +25,9 @@ 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));
@@ -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;