summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2016-11-21 15:25:44 -0500
committerTavian Barnes <tavianator@tavianator.com>2016-11-21 15:28:45 -0500
commit40df4d3d4d6389fbec579e555e79e0ca577e342a (patch)
treec19e920ccbb6c8ffac44b28e654db57fe5e4f9e0 /eval.c
parentf80e6b781d1b98f4b50ed4b235edd1fb3deae199 (diff)
downloadbfs-40df4d3d4d6389fbec579e555e79e0ca577e342a.tar.xz
bftw: Make bftw_flags more similar to fts() options.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/eval.c b/eval.c
index 4fc91cc..9dcb854 100644
--- a/eval.c
+++ b/eval.c
@@ -803,8 +803,11 @@ bool eval_type(const struct expr *expr, struct eval_state *state) {
bool eval_xtype(const struct expr *expr, struct eval_state *state) {
struct BFTW *ftwbuf = state->ftwbuf;
- bool is_root = ftwbuf->depth == 0;
- bool follow = state->cmdline->flags & (is_root ? BFTW_FOLLOW_ROOT : BFTW_FOLLOW_NONROOT);
+ int follow_flags = BFTW_LOGICAL;
+ if (ftwbuf->depth == 0) {
+ follow_flags |= BFTW_COMFOLLOW;
+ }
+ bool follow = state->cmdline->flags & follow_flags;
bool is_link = ftwbuf->typeflag == BFTW_LNK;
if (follow == is_link) {