]> sjero.net Git - wget/commitdiff
[svn] Compensate for MS Windows two-second granularity of file modification
authorabbotti <devnull@localhost>
Fri, 12 Apr 2002 19:21:02 +0000 (12:21 -0700)
committerabbotti <devnull@localhost>
Fri, 12 Apr 2002 19:21:02 +0000 (12:21 -0700)
timestamps.
Submitted by Ian Abbott in <3CB7355C.21011.2134FDA@localhost>.

src/ChangeLog
src/ftp.c
src/http.c

index 5fa69110f7c72cb4f4b9601e2ca341e86f66038a..647a198fb7a17094661d5fce02a00168896d2ee9 100644 (file)
@@ -1,3 +1,10 @@
+2002-04012  Ian Abbott  <abbotti@mev.co.uk>
+
+       * http.c (http_loop): Compensate for MS Windows two-second
+       granularity of file modification time when comparing timestamps.
+
+       * ftp.c (ftp_retrieve_list): Ditto.
+
 2002-04-12  Ian Abbott  <abbotti@mev.co.uk>
 
        * utils.c (has_html_suffix_p): New function to test filename for
index b45a7b52b4e4395da3ed34e996e42bf43bfa029e..c0ded718b718497dac8ca1c3143143bbf08db3cc 100644 (file)
--- a/src/ftp.c
+++ b/src/ftp.c
@@ -1302,6 +1302,11 @@ ftp_retrieve_list (struct url *u, struct fileinfo *f, ccon *con)
              /* Else, get it from the file.  */
              local_size = st.st_size;
              tml = st.st_mtime;
+#ifdef WINDOWS
+             /* Modification time granularity is 2 seconds for Windows, so
+                increase local time by 1 second for later comparison. */
+             tml++;
+#endif
               /* Compare file sizes only for servers that tell us correct
                  values. Assumme sizes being equal for servers that lie
                  about file size.  */
index 3e62856d86540e3d99e04dfeba6def956e77f4d3..c82eb32b6afa88cfec6e6d151848d99eb9420b0b 100644 (file)
@@ -1520,6 +1520,11 @@ File `%s' already there, will not retrieve.\n"), *hstat.local_file);
        {
          use_ts = 1;
          tml = st.st_mtime;
+#ifdef WINDOWS
+         /* Modification time granularity is 2 seconds for Windows, so
+            increase local time by 1 second for later comparison. */
+         tml++;
+#endif
          local_size = st.st_size;
          got_head = 0;
        }