]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/has_examples.c
ccanlint: load file contents on demand, fix names for extracted examples.
[ccan] / tools / ccanlint / tests / has_examples.c
index 6c8fff4d68bfd558b38b2ad398ee652ef185b11b..22d18e9d5a1440004c341d2bde93f3b735707a7b 100644 (file)
@@ -25,7 +25,7 @@ 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, "%s/example-%s-%s",
+                              talloc_asprintf(m, "%s/example-%s-%s.c",
                                               talloc_dirname(m,
                                                              source->fullname),
                                               source->name,
@@ -70,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;