summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2021-06-02 14:19:59 -0400
committerTavian Barnes <tavianator@tavianator.com>2021-06-02 14:19:59 -0400
commit1eeadd8e9402c69afff85b187683bc50292d00a5 (patch)
tree71579104778109fed1848fa32884798cff4ef541 /eval.c
parentea6155677e0f466d05a0027fdbe29827f4a08c2c (diff)
downloadbfs-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.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/eval.c b/eval.c
index c638f10..3a5ab12 100644
--- a/eval.c
+++ b/eval.c
@@ -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;
}