+ if (!ccan_dir) {
+ if (base[0] != '/') {
+ const char *tmpctx = path_cwd(NULL);
+ find_ccan_dir(path_join(tmpctx, tmpctx, base));
+ tal_free(tmpctx);
+ } else {
+ unsigned int prefix = ccan_dir_prefix(base);
+ if (prefix)
+ ccan_dir = tal_strndup(NULL, base, prefix);
+ }
+ }
+ return ccan_dir;