-#include <ccan/talloc/talloc.h>
#include <ccan/err/err.h>
+#include <ccan/tal/path/path.h>
#include "tools.h"
#include <assert.h>
#include <string.h>
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);
+ 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 = talloc_strndup(NULL, base, prefix);
+ ccan_dir = tal_strndup(NULL, base, prefix);
}
}
return ccan_dir;