summaryrefslogtreecommitdiff
path: root/libmisc/walk_tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmisc/walk_tree.c')
-rw-r--r--libmisc/walk_tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libmisc/walk_tree.c b/libmisc/walk_tree.c
index 2777145..30ff92a 100644
--- a/libmisc/walk_tree.c
+++ b/libmisc/walk_tree.c
@@ -78,7 +78,9 @@ static int walk_tree_rec(const char *path, int walk_flags,
return func(path, NULL, flags | WALK_TREE_FAILED, arg);
if (S_ISLNK(st.st_mode)) {
flags |= WALK_TREE_SYMLINK;
- if (flags & WALK_TREE_DEREFERENCE) {
+ if ((flags & WALK_TREE_DEREFERENCE) ||
+ ((flags & WALK_TREE_TOPLEVEL) &&
+ (flags & WALK_TREE_DEREFERENCE_TOPLEVEL))) {
if (stat(path, &st) != 0)
return func(path, NULL,
flags | WALK_TREE_FAILED, arg);