From da02defb91c3a1bda0ea7e653d81f997f1c8884a Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 17 Nov 2022 16:02:57 -0500 Subject: expr: Don't use reftime for -ls reftime is part of a different union than the print actions are supposed to use. --- src/parse.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/parse.c') 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) { -- cgit v1.2.3