#include <ccan/str/str.h>
#include <ccan/read_write_all/read_write_all.h>
#include <ccan/rbuf/rbuf.h>
+#include <ccan/tal/path/path.h>
#include <ccan/compiler/compiler.h>
#include <ccan/err/err.h>
#include "tools.h"
compiled = temp_file(ctx, "", "info");
if (compile_and_link(ctx, info_c_file, find_ccan_dir(dir), "",
- CCAN_COMPILER, CCAN_CFLAGS " -I.", "",
- compiled, &output))
+ compiler, cflags, "", compiled, &output))
return compiled;
return NULL;
}
unsigned int i, n;
bool correct_style = false;
- fname = tal_fmt(ctx, "%s/_info", dir);
+ fname = path_join(ctx, dir, "_info");
raw = tal_grab_file(fname, fname, NULL);
if (!raw)
errx(1, "Could not open %s", fname);
unsigned int i;
deps = get_one(ctx, dir, style, get_info);
+ if (!deps)
+ return NULL;
for (i = 0; i < tal_count(deps)-1; i++) {
char **newdeps;
unsigned int j;
if (!strstarts(deps[i], "ccan/"))
continue;
- subdir = tal_fmt(ctx, "%s/%s", find_ccan_dir(dir), deps[i]);
+ subdir = path_join(ctx, find_ccan_dir(dir), deps[i]);
newdeps = get_one(ctx, subdir, "depends", get_info);
/* Should be short, so brute-force out dups. */
if (!strstarts(deps[i], "ccan/"))
continue;
- subdir = tal_fmt(ctx, "%s/%s",
- find_ccan_dir(dir), deps[i]);
+ subdir = path_join(ctx, find_ccan_dir(dir), deps[i]);
newlibs = get_one_libs(ctx, subdir, get_info);
newlen = tal_count(newlibs);