1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Compensate for MS Windows two-second granularity of file modification

timestamps.
Submitted by Ian Abbott in <3CB7355C.21011.2134FDA@localhost>.
This commit is contained in:
abbotti 2002-04-12 12:21:02 -07:00
parent cfd7b9a951
commit 4aaf8fdcea
3 changed files with 17 additions and 0 deletions

View 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> 2002-04-12 Ian Abbott <abbotti@mev.co.uk>
* utils.c (has_html_suffix_p): New function to test filename for * utils.c (has_html_suffix_p): New function to test filename for

View File

@ -1302,6 +1302,11 @@ ftp_retrieve_list (struct url *u, struct fileinfo *f, ccon *con)
/* Else, get it from the file. */ /* Else, get it from the file. */
local_size = st.st_size; local_size = st.st_size;
tml = st.st_mtime; 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 /* Compare file sizes only for servers that tell us correct
values. Assumme sizes being equal for servers that lie values. Assumme sizes being equal for servers that lie
about file size. */ about file size. */

View File

@ -1520,6 +1520,11 @@ File `%s' already there, will not retrieve.\n"), *hstat.local_file);
{ {
use_ts = 1; use_ts = 1;
tml = st.st_mtime; 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; local_size = st.st_size;
got_head = 0; got_head = 0;
} }