From: Lennart Poettering Date: Wed, 17 Jan 2018 10:13:46 +0000 (+0100) Subject: path-util: do something useful if the prefix is "" in path_make_absolute() X-Git-Tag: v237~86^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=81cce8ded58ed2f2e6ef2227509a90ad60d63502;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/basic/path-util.c b/src/basic/path-util.c index ab4778d4edc..b877bdc1cbe 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);