Fix -mtime, by Ian Abbott
authorGlenn L McGrath <bug1@ihug.co.nz>
Wed, 11 Dec 2002 21:22:21 +0000 (21:22 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Wed, 11 Dec 2002 21:22:21 +0000 (21:22 -0000)
findutils/find.c

index dd02206e3051886dfb8956446b21ea6fa85af7fc..b0f4bca6b7510b3b1372d97550e6f121fd84153b 100644 (file)
@@ -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