summary refs log tree commit diff
path: root/src/bltin
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/bltin/test.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/bltin/test.c b/src/bltin/test.c
index 58c05fe..d1458df 100644
--- a/src/bltin/test.c
+++ b/src/bltin/test.c
@@ -476,9 +476,17 @@ newerf (const char *f1, const char *f2)
 {
 	struct stat b1, b2;
 
+#ifdef HAVE_ST_MTIM
+	return (stat (f1, &b1) == 0 &&
+		stat (f2, &b2) == 0 &&
+		( b1.st_mtim.tv_sec > b2.st_mtim.tv_sec ||
+		 (b1.st_mtim.tv_sec == b2.st_mtim.tv_sec && (b1.st_mtim.tv_nsec > b2.st_mtim.tv_nsec )))
+	);
+#else
 	return (stat (f1, &b1) == 0 &&
 		stat (f2, &b2) == 0 &&
 		b1.st_mtime > b2.st_mtime);
+#endif
 }
 
 static int
@@ -486,9 +494,17 @@ olderf (const char *f1, const char *f2)
 {
 	struct stat b1, b2;
 
+#ifdef HAVE_ST_MTIM
+	return (stat (f1, &b1) == 0 &&
+		stat (f2, &b2) == 0 &&
+		(b1.st_mtim.tv_sec < b2.st_mtim.tv_sec ||
+		 (b1.st_mtim.tv_sec == b2.st_mtim.tv_sec && (b1.st_mtim.tv_nsec < b2.st_mtim.tv_nsec )))
+	);
+#else
 	return (stat (f1, &b1) == 0 &&
 		stat (f2, &b2) == 0 &&
 		b1.st_mtime < b2.st_mtime);
+#endif
 }
 
 static int
00'>2014-01-08README: Spelling and formatting fixesLukas Fleischer 2014-01-08Fix UTF-8 with syntax-highlighting.pyPřemysl Janouch 2014-01-08Add a suggestion to the manpagePřemysl Janouch 2014-01-08Fix the example configurationPřemysl Janouch 2014-01-08Fix about-formatting.shPřemysl Janouch 2014-01-08Fix some spelling errorsPřemysl Janouch 2014-01-08filters: highlight.sh: add css comments for highlight 2.6 and 3.8Ferry Huberts