mirror of
https://github.com/sheumann/hush.git
synced 2025-01-18 07:31:34 +00:00
Fix -mtime, by Ian Abbott
This commit is contained in:
parent
4501dbe509
commit
49b0f86043
@ -84,13 +84,13 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_FEATURE_FIND_MTIME
|
#ifdef CONFIG_FEATURE_FIND_MTIME
|
||||||
if (mtime_days != 0) {
|
if (mtime_char != 0) {
|
||||||
time_t file_age = time(NULL) - statbuf->st_mtime;
|
time_t file_age = time(NULL) - statbuf->st_mtime;
|
||||||
time_t mtime_secs = mtime_days * 24 * 60 * 60;
|
time_t mtime_secs = mtime_days * 24 * 60 * 60;
|
||||||
if (!((isdigit(mtime_char) && mtime_secs >= file_age &&
|
if (!((isdigit(mtime_char) && file_age >= mtime_secs &&
|
||||||
mtime_secs < file_age + 24 * 60 * 60) ||
|
file_age < mtime_secs + 24 * 60 * 60) ||
|
||||||
(mtime_char == '+' && mtime_secs >= file_age) ||
|
(mtime_char == '+' && file_age >= mtime_secs + 24 * 60 * 60) ||
|
||||||
(mtime_char == '-' && mtime_secs < file_age)))
|
(mtime_char == '-' && file_age < mtime_secs)))
|
||||||
goto no_match;
|
goto no_match;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user