]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
namei: simplify code
authorKarel Zak <kzak@redhat.com>
Thu, 17 Jun 2021 11:23:53 +0000 (13:23 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 17 Jun 2021 11:23:53 +0000 (13:23 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/namei.c

index 9c5f5fa4ac3952423c1c5f9e4b4d3ae4b157c148..3d50b200dbbea87ff5321a60a4bd559ed65a9cc0 100644 (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) = '/';