Merge pull request #8554 from poettering/chase-trail-slash

fs-util: add new CHASE_TRAIL_SLASH flag for chase_symlinks()
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2018-03-26 18:00:08 +02:00
committed by GitHub
11 changed files with 21 additions and 21 deletions
+4 -2
View File
@@ -683,8 +683,10 @@ int chase_symlinks(const char *path, const char *original_root, unsigned flags,
/* Just a single slash? Then we reached the end. */
if (path_equal(first, "/")) {
/* Preserve the trailing slash */
if (!strextend(&done, "/", NULL))
return -ENOMEM;
if (flags & CHASE_TRAIL_SLASH)
if (!strextend(&done, "/", NULL))
return -ENOMEM;
break;
}