mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 08:56:15 +09: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:
@@ -127,7 +127,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;
|
||||
|
||||
Reference in New Issue
Block a user