]> sjero.net Git - wget/blobdiff - src/ftp-ls.c
[svn] ChangeLog: Removed an excess conflict marker. Reformatted the entry by
[wget] / src / ftp-ls.c
index 4eb39cf2badabd0558711c3014a6962036db52f5..22d1887aaba48ca458321b6e7993b503ce2a81bc 100644 (file)
@@ -410,7 +410,7 @@ ftp_parse_winnt_ls (const char *file)
   FILE *fp;
   int len;
   int year, month, day;         /* for time analysis */
-  int hour, min, sec;
+  int hour, min;
   struct tm timestruct;
 
   char *line, *tok;             /* tokenizer */
@@ -450,22 +450,21 @@ ftp_parse_winnt_ls (const char *file)
       /* Assuming the epoch starting at 1.1.1970 */
       if (year <= 70) year += 100;
 
-      /* Second column: hh:mm[AP]M */
+      /* Second column: hh:mm[AP]M, listing does not contain value for
+         seconds */
       tok = strtok(NULL,  ":");
       hour = atoi(tok);
       tok = strtok(NULL,  "M");
       min = atoi(tok);
       /* Adjust hour from AM/PM */
       tok+=2;
-      if (*tok == 'P') hour += 12;
-      /* Listing does not contain value for seconds */
-      sec = 0;
+      if (*tok == 'P') hour = (hour + 12) % 24;
 
       DEBUGP(("YYYY/MM/DD HH:MM - %d/%02d/%02d %02d:%02d\n", 
               year+1900, month, day, hour, min));
       
       /* Build the time-stamp (copy & paste from above) */
-      timestruct.tm_sec   = sec;
+      timestruct.tm_sec   = 0;
       timestruct.tm_min   = min;
       timestruct.tm_hour  = hour;
       timestruct.tm_mday  = day;