summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-06-07 14:04:20 -0400
committerTavian Barnes <tavianator@tavianator.com>2020-06-07 15:16:10 -0400
commit1bce3b33acbfcfbfa03f1174d6e00c125cd8625d (patch)
tree9cb9efd81d667b711845878310afb39183cae847 /eval.c
parentfaee855b1e886dacc999e1dccf7f8e2c750f33c6 (diff)
downloadbfs-1bce3b33acbfcfbfa03f1174d6e00c125cd8625d.tar.xz
Implement -exclude, a special form for convenient exclusions
Fixes #8.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 114bb53..41e0377 100644
--- a/eval.c
+++ b/eval.c
@@ -1193,6 +1193,11 @@ static enum bftw_action cmdline_callback(const struct BFTW *ftwbuf, void *ptr) {
}
}
+ if (eval_expr(cmdline->exclude, &state)) {
+ state.action = BFTW_PRUNE;
+ goto done;
+ }
+
if (cmdline->xargs_safe && strpbrk(ftwbuf->path, " \t\n\'\"\\")) {
args->ret = EXIT_FAILURE;
eval_error(&state, "Path is not safe for xargs.\n");