diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2022-11-17 16:02:57 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2022-11-17 16:02:57 -0500 |
commit | da02defb91c3a1bda0ea7e653d81f997f1c8884a (patch) | |
tree | 2b58212b064989b01c90d7d78fa00cedc9e4bec2 /src/parse.c | |
parent | 3604eeddb8a317c0745e92680d0405c645fbe247 (diff) | |
download | bfs-da02defb91c3a1bda0ea7e653d81f997f1c8884a.tar.xz |
expr: Don't use reftime for -ls
reftime is part of a different union than the print actions are supposed
to use.
Diffstat (limited to 'src/parse.c')
-rw-r--r-- | src/parse.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/parse.c b/src/parse.c index fc30cd2..a1e32fd 100644 --- a/src/parse.c +++ b/src/parse.c @@ -284,7 +284,7 @@ struct parser_state { /** An "-ok"-type expression, if any. */ const struct bfs_expr *ok_expr; - /** The current time. */ + /** The current time (maybe modified by -daystart). */ struct timespec now; }; @@ -1527,7 +1527,6 @@ static struct bfs_expr *parse_fls(struct parser_state *state, int arg1, int arg2 expr_set_always_true(expr); expr->cost = PRINT_COST; - expr->reftime = state->now; return expr; fail: @@ -1772,7 +1771,6 @@ static struct bfs_expr *parse_ls(struct parser_state *state, int arg1, int arg2) } init_print_expr(state, expr); - expr->reftime = state->now; return expr; } @@ -3892,6 +3890,7 @@ struct bfs_ctx *bfs_parse_cmdline(int argc, char *argv[]) { .files0_arg = NULL, .files0_stdin_arg = NULL, .ok_expr = NULL, + .now = ctx->now, }; if (strcmp(xbasename(state.command), "find") == 0) { @@ -3899,11 +3898,6 @@ struct bfs_ctx *bfs_parse_cmdline(int argc, char *argv[]) { ctx->strategy = BFTW_DFS; } - if (xgettime(&state.now) != 0) { - parse_perror(&state, "xgettime()"); - goto fail; - } - ctx->exclude = &bfs_false; ctx->expr = parse_whole_expr(&state); if (!ctx->expr) { |