mirror of
https://github.com/systemd/systemd.git
synced 2024-11-07 09:56:51 +03:00
path-util: don't insert duplicate "/" in path_make_absolute_cwd()
When the working directory is "/" it's prettier not to insert a second "/" in the path, even though it is technically correct.
This commit is contained in:
parent
d72495759b
commit
7aeeb313ad
@ -127,7 +127,10 @@ int path_make_absolute_cwd(const char *p, char **ret) {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
c = strjoin(cwd, "/", p);
|
if (endswith(cwd, "/"))
|
||||||
|
c = strjoin(cwd, p);
|
||||||
|
else
|
||||||
|
c = strjoin(cwd, "/", p);
|
||||||
}
|
}
|
||||||
if (!c)
|
if (!c)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
Loading…
Reference in New Issue
Block a user