From 1bce3b33acbfcfbfa03f1174d6e00c125cd8625d Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 7 Jun 2020 14:04:20 -0400 Subject: Implement -exclude, a special form for convenient exclusions Fixes #8. --- eval.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'eval.c') 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"); -- cgit v1.2.3