diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2021-01-13 09:41:42 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2021-01-13 09:41:42 -0500 |
commit | ff215e6665c03e37fcb640a0a431a3bee5f7bbaf (patch) | |
tree | 1c48fc87b2ca044087a405de83d2a350b1fa2da1 /eval.c | |
parent | 2ca72a38dad1a4afcdbb00e536384024532059a4 (diff) | |
download | bfs-ff215e6665c03e37fcb640a0a431a3bee5f7bbaf.tar.xz |
-used: Make the implementation match the GNU fixes for findutils 4.8.0
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -261,8 +261,13 @@ bool eval_used(const struct expr *expr, struct eval_state *state) { return false; } - time_t diff = timespec_diff(atime, ctime); - diff /= 60*60*24; + long long diff = timespec_diff(atime, ctime); + if (diff < 0) { + return false; + } + + long long day_seconds = 60*60*24; + diff = (diff + day_seconds - 1) / day_seconds; return expr_cmp(expr, diff); } |