Hello,

this is a bug report with a patch for the latest CVS version of wget.

When I do recursive wget from FTP servers running Windows,
the files get wrong timestamps. They always show the next month
(e.g. february instead of january, june instead of may).

Function mktime in ftp-ls.c should be called with month values
from 0 to 11 (in struct tm), but it gets values from 1 to 12
in functions ftp_parse_winnt_ls() and ftp_parse_vms_ls().

The patch fixes these two functions and a minor spelling bug
in some debug output. Please note that I could only test the
fix for ftp_parse_winnt_ls() because I do not know FTP servers
running on VMS machines.

Regards,
Stefan Weil <[EMAIL PROTECTED]>

Appendices

ChangeLog entry

2001-05-02      Stefan Weil     <Stefan.Weil|de.heidelberg.com>
        * src/ftp-ls.c: Fixed timestamps for Windows and VMS ftp servers.

Patch

Index: src/ftp-ls.c
===================================================================
RCS file: /pack/anoncvs/wget/src/ftp-ls.c,v
retrieving revision 1.16
diff -u -r1.16 ftp-ls.c
--- src/ftp-ls.c        2001/04/14 04:11:35     1.16
+++ src/ftp-ls.c        2001/05/02 07:26:35
@@ -146,7 +146,7 @@
          break;
        default:
          cur.type = FT_UNKNOWN;
-         DEBUGP (("UNKOWN; "));
+         DEBUGP (("UNKNOWN; "));
          break;
        }
 
@@ -471,7 +471,7 @@
       timestruct.tm_min   = min;
       timestruct.tm_hour  = hour;
       timestruct.tm_mday  = day;
-      timestruct.tm_mon   = month;
+      timestruct.tm_mon   = month - 1;
       timestruct.tm_year  = year;
       timestruct.tm_wday  = 0;
       timestruct.tm_yday  = 0;
@@ -692,7 +692,7 @@
       timestruct.tm_min   = min;
       timestruct.tm_hour  = hour;
       timestruct.tm_mday  = day;
-      timestruct.tm_mon   = month;
+      timestruct.tm_mon   = month - 1;
       timestruct.tm_year  = year;
       timestruct.tm_wday  = 0;
       timestruct.tm_yday  = 0;

Reply via email to