summaryrefslogtreecommitdiffstats
path: root/parse.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-04-16 12:14:02 -0400
committerTavian Barnes <tavianator@tavianator.com>2017-04-16 12:14:02 -0400
commite42e0f1012229e4473919c738ab7e4bcaff8033a (patch)
treed4e7d16a4e2ece4b4de1aac1d8075369d8d645a0 /parse.c
parent455b724279c1cb4aefc0d2f81b65641990dd7689 (diff)
downloadbfs-e42e0f1012229e4473919c738ab7e4bcaff8033a.tar.xz
Implement -X
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/parse.c b/parse.c
index 193278a..ced1306 100644
--- a/parse.c
+++ b/parse.c
@@ -744,6 +744,14 @@ static struct expr *parse_follow(struct parser_state *state, int flags, int opti
}
/**
+ * Parse -X.
+ */
+static struct expr *parse_xargs_safe(struct parser_state *state, int arg1, int arg2) {
+ state->cmdline->xargs_safe = true;
+ return parse_nullary_flag(state);
+}
+
+/**
* Parse -executable, -readable, -writable
*/
static struct expr *parse_access(struct parser_state *state, int flag, int arg2) {
@@ -1946,6 +1954,7 @@ static const struct table_entry parse_table[] = {
{"P", false, parse_follow, 0, false},
{"H", false, parse_follow, BFTW_COMFOLLOW, false},
{"L", false, parse_follow, BFTW_LOGICAL | BFTW_DETECT_CYCLES, false},
+ {"X", false, parse_xargs_safe},
{"a"},
{"amin", false, parse_acmtime, ATIME, MINUTES},
{"and"},
@@ -2627,6 +2636,7 @@ struct cmdline *parse_cmdline(int argc, char *argv[]) {
cmdline->flags = BFTW_RECOVER;
cmdline->optlevel = 3;
cmdline->debug = 0;
+ cmdline->xargs_safe = false;
cmdline->ignore_races = false;
cmdline->expr = &expr_true;
cmdline->nopen_files = 0;