]> granicus.if.org Git - vim/commitdiff
patch 8.2.3515: nano time test fails on Mac and FreeBSD v8.2.3515
authorichizok <gclient.gaap@gmail.com>
Fri, 15 Oct 2021 16:23:12 +0000 (17:23 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 15 Oct 2021 16:23:12 +0000 (17:23 +0100)
Problem:    Nano time test fails on Mac and FreeBSD.
Solution:   Also check nano time when not on Linux. (Ozaki Kiichi,
            closes #9000)

src/fileio.c
src/version.c

index 63d083e1592af616499b0bc8133e7acec9e1dc3d..2f3dc396bd96fb85b075b0ff206bc6f8f887d90c 100644 (file)
@@ -3121,18 +3121,19 @@ msg_add_eol(void)
     int
 time_differs(stat_T *st, long mtime, long mtime_ns UNUSED)
 {
+    return
+#ifdef ST_MTIM_NSEC
+       (long)st->ST_MTIM_NSEC != mtime_ns ||
+#endif
 #if defined(__linux__) || defined(MSWIN)
-    // On a FAT filesystem, esp. under Linux, there are only 5 bits to store
-    // the seconds.  Since the roundoff is done when flushing the inode, the
-    // time may change unexpectedly by one second!!!
-    return (long)st->st_mtime - mtime > 1 || mtime - (long)st->st_mtime > 1
-# ifdef ST_MTIM_NSEC
-               || (long)st->ST_MTIM_NSEC != mtime_ns
-# endif
-               ;
+       // On a FAT filesystem, esp. under Linux, there are only 5 bits to store
+       // the seconds.  Since the roundoff is done when flushing the inode, the
+       // time may change unexpectedly by one second!!!
+       (long)st->st_mtime - mtime > 1 || mtime - (long)st->st_mtime > 1
 #else
-    return (long)st->st_mtime != mtime;
+       (long)st->st_mtime != mtime
 #endif
+       ;
 }
 
 /*
index f7ebc702b17b30c417e03bf81f8eb85947ea2488..f7af2d75933b0b63e0f7b4bf2afb4ca9ce6e9f38 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3515,
 /**/
     3514,
 /**/