+ if (!ccan_dir) {
+ if (base[0] != '/') {
+ const char *tmpctx = talloc_getcwd(NULL);
+ find_ccan_dir(talloc_asprintf(tmpctx, "%s/%s",
+ tmpctx, base));
+ talloc_free(tmpctx);
+ } else {
+ unsigned int prefix = ccan_dir_prefix(base);
+ if (prefix)
+ ccan_dir = talloc_strndup(NULL, base, prefix);
+ }
+ }
+ return ccan_dir;