summaryrefslogtreecommitdiff
path: root/remake.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2000-11-17 06:59:08 +0000
committerPaul Smith <psmith@gnu.org>2000-11-17 06:59:08 +0000
commite5324a8c6a6380b544be8d64773827e976bea35a (patch)
tree942f37674ec8174831592e7b25745dd3041eada6 /remake.c
parentd5a04ee9849e300f0e4b751ca7c1d1fd96f312a1 (diff)
downloadgunmake-e5324a8c6a6380b544be8d64773827e976bea35a.tar.gz
* Fix FAT handling on Windows to match the DJGPP port's FAT handling.
* Fix a potential hole in readline if lines end in ^M (CRLF).
Diffstat (limited to 'remake.c')
-rw-r--r--remake.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/remake.c b/remake.c
index 2fd85e8..f036b53 100644
--- a/remake.c
+++ b/remake.c
@@ -1170,21 +1170,12 @@ f_mtime (file, search)
FILE_TIMESTAMP adjusted_mtime = mtime;
#if defined(WINDOWS32) || defined(__MSDOS__)
- FILE_TIMESTAMP adjustment;
-#ifdef WINDOWS32
- /* FAT filesystems round time to the nearest even second!
- Allow for any file (NTFS or FAT) to perhaps suffer from this
- brain damage. */
- adjustment = (((FILE_TIMESTAMP_S (adjusted_mtime) & 1) == 0
- && FILE_TIMESTAMP_NS (adjusted_mtime) == 0)
- ? (FILE_TIMESTAMP) 1 << FILE_TIMESTAMP_LO_BITS
- : 0);
-#else
- /* On DJGPP under Windows 98 and Windows NT, FAT filesystems can
- set file times up to 3 seconds into the future! The bug doesn't
- occur in plain DOS or in Windows 95, but we play it safe. */
- adjustment = (FILE_TIMESTAMP) 3 << FILE_TIMESTAMP_LO_BITS;
-#endif
+ /* Experimentation has shown that FAT filesystems can set file times
+ up to 3 seconds into the future! Play it safe. */
+
+#define FAT_ADJ_OFFSET (FILE_TIMESTAMP) 3
+
+ FILE_TIMESTAMP adjustment = FAT_ADJ_OFFSET << FILE_TIMESTAMP_LO_BITS;
if (ORDINARY_MTIME_MIN + adjustment <= adjusted_mtime)
adjusted_mtime -= adjustment;
#endif