mirror of
https://github.com/systemd/systemd.git
synced 2024-12-26 03:22:00 +03:00
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.
This commit is contained in:
parent
5caf49360b
commit
81cce8ded5
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user