projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5caf493
)
path-util: do something useful if the prefix is "" in path_make_absolute()
author
Lennart Poettering
<lennart@poettering.net>
Wed, 17 Jan 2018 10:13:46 +0000
(11:13 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 17 Jan 2018 10:14:28 +0000
(11:14 +0100)
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
patch
|
blob
|
history
diff --git
a/src/basic/path-util.c
b/src/basic/path-util.c
index
ab4778d
..
b877bdc
100644
(file)
--- 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);