chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
systemctl: refuse to edit runtime dropins when they already exist in /etc
[elogind.git]
/
src
/
shared
/
path-util.c
diff --git
a/src/shared/path-util.c
b/src/shared/path-util.c
index b3fe0b81791f618949b4cbac1b183f3ba3e0b858..dcc8321f505ee685727ae8b3a7f3565eb6795b2d 100644
(file)
--- a/
src/shared/path-util.c
+++ b/
src/shared/path-util.c
@@
-439,14
+439,14
@@
char* path_join(const char *root, const char *path, const char *rest) {
assert(path);
if (!isempty(root))
assert(path);
if (!isempty(root))
- return strjoin(root, "/",
+ return strjoin(root,
endswith(root, "/") ? "" :
"/",
path[0] == '/' ? path+1 : path,
path[0] == '/' ? path+1 : path,
- rest ?
"/"
: NULL,
+ rest ?
(endswith(path, "/") ? "" : "/")
: NULL,
rest && rest[0] == '/' ? rest+1 : rest,
NULL);
else
return strjoin(path,
rest && rest[0] == '/' ? rest+1 : rest,
NULL);
else
return strjoin(path,
- rest ?
"/"
: NULL,
+ rest ?
(endswith(path, "/") ? "" : "/")
: NULL,
rest && rest[0] == '/' ? rest+1 : rest,
NULL);
}
rest && rest[0] == '/' ? rest+1 : rest,
NULL);
}