From 81cce8ded58ed2f2e6ef2227509a90ad60d63502 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 17 Jan 2018 11:13:46 +0100 Subject: [PATCH] path-util: do something useful if the prefix is "" in path_make_absolute() Do not insert a "/" if the prefix we shall use is empty. It's a corner case we should probably take care of. --- src/basic/path-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic/path-util.c b/src/basic/path-util.c index ab4778d4ed..b877bdc1cb 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -81,7 +81,7 @@ char *path_make_absolute(const char *p, const char *prefix) { /* Makes every item in the list an absolute path by prepending * the prefix, if specified and necessary */ - if (path_is_absolute(p) || !prefix) + if (path_is_absolute(p) || isempty(prefix)) return strdup(p); return strjoin(prefix, "/", p);