X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fdepends.c;h=82524da0a256977ac61191f8ebf2b8d689e5eace;hp=ca1b6fc88b0f893814cb279f26b8ec4be3e77e9b;hb=7a0402de904de11843f9eb8a4bf8469206426c34;hpb=104125b2dd0a044fb3d68f9bc3b1b18c9f32ae2b diff --git a/tools/depends.c b/tools/depends.c index ca1b6fc8..82524da0 100644 --- a/tools/depends.c +++ b/tools/depends.c @@ -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;