Simplify external allocation (realloc only from Tridge)
[ccan] / tools / run_tests.c
index 2f657d0533ee8c92e5916ca09c529407b80d5257..a1fbc614918851e50657adb8bfa53caeba695297 100644 (file)
@@ -106,14 +106,11 @@ static int build(const char *dir, const char *name, int fail)
        char **deps;
 
        for (deps = get_deps(objs, dir); *deps; deps++) {
        char **deps;
 
        for (deps = get_deps(objs, dir); *deps; deps++) {
-               char *end;
                if (!strstarts(*deps, "ccan/"))
                        continue;
 
                if (!strstarts(*deps, "ccan/"))
                        continue;
 
-               end = strrchr(*deps, '/') + 1;
-               /* ccan/foo -> ccan/libfoo.a */
-               externals = talloc_asprintf_append(externals,
-                                                  " ccan/lib%s.a", end);
+               /* ccan/foo -> ccan/foo.o */
+               externals = talloc_asprintf_append(externals, " %s.o", *deps);
        }
 
        cmd = talloc_asprintf(name, "gcc " CFLAGS " %s -o %s %s %s%s%s",
        }
 
        cmd = talloc_asprintf(name, "gcc " CFLAGS " %s -o %s %s %s%s%s",