chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
08bd726
)
path-util: don't insert duplicate "/" in path_make_absolute_cwd()
author
Lennart Poettering
<lennart@poettering.net>
Wed, 17 Jan 2018 10:17:55 +0000
(11:17 +0100)
committer
Sven Eden
<yamakuzure@gmx.net>
Wed, 30 May 2018 05:50:10 +0000
(07:50 +0200)
When the working directory is "/" it's prettier not to insert a second
"/" in the path, even though it is technically correct.
src/basic/path-util.c
patch
|
blob
|
history
diff --git
a/src/basic/path-util.c
b/src/basic/path-util.c
index c483d04715686403702bc973678a9b5058caad99..c350bc85e9474b80d35123a593f8cc3a5ed8d3d0 100644
(file)
--- a/
src/basic/path-util.c
+++ b/
src/basic/path-util.c
@@
-129,7
+129,10
@@
int path_make_absolute_cwd(const char *p, char **ret) {
if (r < 0)
return r;
- c = strjoin(cwd, "/", p);
+ if (endswith(cwd, "/"))
+ c = strjoin(cwd, p);
+ else
+ c = strjoin(cwd, "/", p);
}
if (!c)
return -ENOMEM;