]> git.ozlabs.org Git - ccan/blobdiff - tools/depends.c
asprintf: new asprintf module.
[ccan] / tools / depends.c
index ca1b6fc88b0f893814cb279f26b8ec4be3e77e9b..82524da0a256977ac61191f8ebf2b8d689e5eace 100644 (file)
@@ -59,11 +59,12 @@ static char *compile_info(const void *ctx, const char *dir)
                return NULL;
 
        ccandir = talloc_dirname(ctx, dir);
-       *strrchr(ccandir, '/') = '\0';
+       if (strrchr(ccandir, '/'))
+               *strrchr(ccandir, '/') = '\0';
 
        compiled = maybe_temp_file(ctx, "", false, "info");
        if (compile_and_link(ctx, info_c_file, ccandir, "",
-                            CCAN_COMPILER, CCAN_CFLAGS, "",
+                            CCAN_COMPILER, CCAN_CFLAGS " -I.", "",
                             compiled, &output))
                return compiled;
        return NULL;