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
|
/* Makes every item in the list an absolute path by prepending
|
||||||
* the prefix, if specified and necessary */
|
* the prefix, if specified and necessary */
|
||||||
|
|
||||||
if (path_is_absolute(p) || !prefix)
|
if (path_is_absolute(p) || isempty(prefix))
|
||||||
return strdup(p);
|
return strdup(p);
|
||||||
|
|
||||||
return strjoin(prefix, "/", p);
|
return strjoin(prefix, "/", p);
|
||||||
|
|
Loading…
Reference in a new issue