aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2021-04-15 17:39:51 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2021-04-15 17:40:00 -0500
commit791322d7fa9d5bbceed558258baeff51a39787c5 (patch)
tree92d8ead082b69b2579cc789c3b1f18fefe422033
parent63db2d99e730547339d1bdd28e8437999c380cae (diff)
checkpath: fix code to walk the directory path
X-Gentoo-Bug: 782808 X-Gentoo-Bug-URL: https://bugs.gentoo.org/782808
-rw-r--r--src/rc/checkpath.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c
index b2d1dd23..bab22692 100644
--- a/src/rc/checkpath.c
+++ b/src/rc/checkpath.c
@@ -132,13 +132,14 @@ static int get_dirfd(char *path, bool symlinks)
*/
close(new_dirfd);
} else {
+ /* now walk down the directory path */
close(dirfd);
dirfd = new_dirfd;
free(linkpath);
linkpath = NULL;
+ item = strtok(NULL, "/");
+ components--;
}
- item = strtok(NULL, "/");
- components--;
}
free(path_dupe);
free(linkpath);