diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2021-06-02 14:19:59 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2021-06-02 14:19:59 -0400 |
commit | 1eeadd8e9402c69afff85b187683bc50292d00a5 (patch) | |
tree | 71579104778109fed1848fa32884798cff4ef541 /eval.c | |
parent | ea6155677e0f466d05a0027fdbe29827f4a08c2c (diff) | |
download | bfs-1eeadd8e9402c69afff85b187683bc50292d00a5.tar.xz |
Implement time units for -{a,B,c,m}time
From FreeBSD find. Closes #75.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -236,11 +236,13 @@ bool eval_time(const struct expr *expr, struct eval_state *state) { time_t diff = timespec_diff(&expr->reftime, time); switch (expr->time_unit) { + case DAYS: + diff /= 60*24; + fallthrough; case MINUTES: diff /= 60; - break; - case DAYS: - diff /= 60*60*24; + fallthrough; + case SECONDS: break; } |