aboutsummaryrefslogtreecommitdiff
path: root/findutils
diff options
context:
space:
mode:
authorbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2002-12-11 21:22:21 +0000
committerbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2002-12-11 21:22:21 +0000
commit0685abfd0f1da692407aa4dec3100df715f3b206 (patch)
tree65320ff06c5756556e6a4fafe193ae4532fc5fe1 /findutils
parent464f44ba050cd938b9c57df9880f84804095c32a (diff)
downloadbusybox-w32-0685abfd0f1da692407aa4dec3100df715f3b206.tar.gz
busybox-w32-0685abfd0f1da692407aa4dec3100df715f3b206.tar.bz2
busybox-w32-0685abfd0f1da692407aa4dec3100df715f3b206.zip
Fix -mtime, by Ian Abbott
git-svn-id: svn://busybox.net/trunk/busybox@6173 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'findutils')
-rw-r--r--findutils/find.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/findutils/find.c b/findutils/find.c
index dd02206e3..b0f4bca6b 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -84,13 +84,13 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
84 } 84 }
85#endif 85#endif
86#ifdef CONFIG_FEATURE_FIND_MTIME 86#ifdef CONFIG_FEATURE_FIND_MTIME
87 if (mtime_days != 0) { 87 if (mtime_char != 0) {
88 time_t file_age = time(NULL) - statbuf->st_mtime; 88 time_t file_age = time(NULL) - statbuf->st_mtime;
89 time_t mtime_secs = mtime_days * 24 * 60 * 60; 89 time_t mtime_secs = mtime_days * 24 * 60 * 60;
90 if (!((isdigit(mtime_char) && mtime_secs >= file_age && 90 if (!((isdigit(mtime_char) && file_age >= mtime_secs &&
91 mtime_secs < file_age + 24 * 60 * 60) || 91 file_age < mtime_secs + 24 * 60 * 60) ||
92 (mtime_char == '+' && mtime_secs >= file_age) || 92 (mtime_char == '+' && file_age >= mtime_secs + 24 * 60 * 60) ||
93 (mtime_char == '-' && mtime_secs < file_age))) 93 (mtime_char == '-' && file_age < mtime_secs)))
94 goto no_match; 94 goto no_match;
95 } 95 }
96#endif 96#endif