assert_se(find_binary("/some/dir/xxxx-xxxx", local, &p) ==
(local ? -ENOENT : 0));
+ if (!local)
+ free(p);
}
static void test_prefixes(void) {
test_join("/root", "/a/b", "/c", "/root/a/b/c");
test_join("/root", "a/b", "c", "/root/a/b/c");
test_join("/root", "/a/b", "c", "/root/a/b/c");
- test_join("/root", "/", "c", "/root//c");
+ test_join("/root", "/", "c", "/root/c");
test_join("/root", "/", NULL, "/root/");
test_join(NULL, "/a/b", "/c", "/a/b/c");
test_join(NULL, "a/b", "c", "a/b/c");
test_join(NULL, "/a/b", "c", "/a/b/c");
- test_join(NULL, "/", "c", "//c");
+ test_join(NULL, "/", "c", "/c");
test_join(NULL, "/", NULL, "/");
}