X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fmanifest.c;h=024eaa42a0d42c469e08f2ccba78846f58e0f1d5;hp=9de9030b2a0e71d6e18f95c36536fe98a4c5ad35;hb=add10b0b9d13d9437682268badfab029ed36c244;hpb=08eb7e5a370941feec1d556339a00608925f9cb2 diff --git a/tools/manifest.c b/tools/manifest.c index 9de9030b..024eaa42 100644 --- a/tools/manifest.c +++ b/tools/manifest.c @@ -23,8 +23,6 @@ #include #include -const char *ccan_dir; - static size_t dir_hash(const char *name) { return hash(name, strlen(name), 0); @@ -196,22 +194,6 @@ static void sort_files(struct list_head *list) talloc_free(files); } -/* Walk up tp find /ccan/ => ccan directory. */ -static unsigned int ccan_dir_prefix(const char *fulldir) -{ - unsigned int i; - - assert(fulldir[0] == '/'); - for (i = strlen(fulldir) - 1; i > 0; i--) { - if (strncmp(fulldir+i, "/ccan", 5) != 0) - continue; - if (fulldir[i+5] != '\0' && fulldir[i+5] != '/') - continue; - return i + 1; - } - errx(1, "Could not find /ccan/ dir in %s", fulldir); -} - struct manifest *get_manifest(const void *ctx, const char *dir) { struct manifest *m; @@ -265,12 +247,6 @@ struct manifest *get_manifest(const void *ctx, const char *dir) errx(1, "I don't expect to be run from the root directory"); m->basename++; - if (!ccan_dir) { - unsigned int prefix = ccan_dir_prefix(m->dir); - - ccan_dir = talloc_strndup(NULL, m->dir, prefix); - } - add_files(m, ""); /* Nicer to run tests in a predictable order. */