summaryrefslogtreecommitdiffstats
path: root/color.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2019-09-04 21:35:24 -0400
committerTavian Barnes <tavianator@tavianator.com>2019-09-04 21:35:24 -0400
commited6d3933070f7cfbb0607aabe8f9e71ca384791a (patch)
tree7ab24161806269f58e7af2865c27a247e2a226bb /color.c
parent1563c3113710463d07f52d6f042a01c56a9ea795 (diff)
downloadbfs-ed6d3933070f7cfbb0607aabe8f9e71ca384791a.tar.xz
color: Actually resolve symlinks against their parent directory
Diffstat (limited to 'color.c')
-rw-r--r--color.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/color.c b/color.c
index aecee74..1c06d68 100644
--- a/color.c
+++ b/color.c
@@ -734,7 +734,7 @@ static ssize_t first_broken_offset(const char *path, const struct BFTW *ftwbuf,
}
} else {
// We're in print_link_target(), so resolve relative to the link's parent directory
- at_fd = AT_FDCWD;
+ at_fd = ftwbuf->at_fd;
if (at_fd == AT_FDCWD && path[0] != '/') {
at_path = dstrndup(ftwbuf->path, ftwbuf->nameoff);
if (at_path && dstrncat(&at_path, path, max) != 0) {