namei: simplify code

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2021-06-17 13:23:53 +02:00
parent 19f2cebd48
commit 403cd1086e
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@ readlink_to_namei(struct namei *nm, const char *path)
}
nm->abslink = xmalloc(sz + 1);
if (*sym != '/' && isrel) {
if (isrel) {
/* create the absolute path from the relative symlink */
memcpy(nm->abslink, path, nm->relstart);
*(nm->abslink + nm->relstart) = '/';