From 40df4d3d4d6389fbec579e555e79e0ca577e342a Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 21 Nov 2016 15:25:44 -0500 Subject: bftw: Make bftw_flags more similar to fts() options. --- eval.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'eval.c') 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) { -- cgit v1.2.3