From b972115c97b9ec1bb17ee4897da6b85d82727ca8 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Sat, 12 Apr 2014 17:17:49 -0400 Subject: path-util: also check for existence of binary when given absolute path In contrast to a filename-only argument, find_binary() did not actually check if an path exists, allowing the code to fail later on. This was OK, but it seems nicer to treat both paths identically. Also take advantage of path_make_absolute_cwd doing strdup() by itself if necessary to simplify. --- src/test/test-path-util.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/test/test-path-util.c') diff --git a/src/test/test-path-util.c b/src/test/test-path-util.c index a2cf0af75f..527b275656 100644 --- a/src/test/test-path-util.c +++ b/src/test/test-path-util.c @@ -104,6 +104,8 @@ static void test_find_binary(void) { free(p); assert(find_binary("xxxx-xxxx", &p) == -ENOENT); + + assert(find_binary("/some/dir/xxxx-xxxx", &p) == -ENOENT); } static void test_prefixes(void) { -- cgit v1.2.3-54-g00ecf