summaryrefslogtreecommitdiffhomepage
path: root/findutils
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2002-12-11 21:22:21 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2002-12-11 21:22:21 +0000
commit49b0f86043beffb9096af83f159a6f7fd151ca30 (patch)
tree65320ff06c5756556e6a4fafe193ae4532fc5fe1 /findutils
parent4501dbe5099df8f9b752165af927719c5b06b9b2 (diff)
Fix -mtime, by Ian Abbott
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)
}
#endif
#ifdef CONFIG_FEATURE_FIND_MTIME
- if (mtime_days != 0) {
+ if (mtime_char != 0) {
time_t file_age = time(NULL) - statbuf->st_mtime;
time_t mtime_secs = mtime_days * 24 * 60 * 60;
- if (!((isdigit(mtime_char) && mtime_secs >= file_age &&
- mtime_secs < file_age + 24 * 60 * 60) ||
- (mtime_char == '+' && mtime_secs >= file_age) ||
- (mtime_char == '-' && mtime_secs < file_age)))
+ if (!((isdigit(mtime_char) && file_age >= mtime_secs &&
+ file_age < mtime_secs + 24 * 60 * 60) ||
+ (mtime_char == '+' && file_age >= mtime_secs + 24 * 60 * 60) ||
+ (mtime_char == '-' && file_age < mtime_secs)))
goto no_match;
}
#endif