]> sjero.net Git - wget/commitdiff
[svn] Make seconds optional in VMS time specification.
authorhniksic <devnull@localhost>
Thu, 12 Apr 2001 12:22:50 +0000 (05:22 -0700)
committerhniksic <devnull@localhost>
Thu, 12 Apr 2001 12:22:50 +0000 (05:22 -0700)
Published in <sxs8zl62u9p.fsf@florida.arsdigita.de>.

src/ChangeLog
src/ftp-ls.c

index 81cc52a7c4e2ad94f2b49f18797caafb356c353d..cc4f276b7ffe0a1f6e29c844a00f82f31cbab7aa 100644 (file)
@@ -1,3 +1,8 @@
+2001-04-12  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * ftp-ls.c (ftp_parse_vms_ls): Make seconds optional in time
+       specification.
+
 2001-04-11  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * url.c (parseurl): Don't strip trailing slash when u->dir is "/"
index ca7f43f5ab9030f8d95403a7e03b81a90d3a94f5..338c1a4e27b3b270d3708e72342dbbd3d5b1c25a 100644 (file)
@@ -584,6 +584,7 @@ ftp_parse_vms_ls (const char *file)
   /* Line loop to end of file: */
   while ((line = read_whole_line (fp)))
     {
+      char *p;
       i = clean_line (line);
       if (!i) break;
 
@@ -670,13 +671,17 @@ ftp_parse_vms_ls (const char *file)
       year = atoi(tok)-1900;
       DEBUGP(("date parsed\n"));
 
-      /* Fourth/Third column: Time hh:mm:ss */
-      tok = strtok(NULL,  ":");
-      hour = atoi(tok);
-      tok = strtok(NULL,  ":");
-      min = atoi(tok);
-      tok = strtok(NULL,  " ");
-      sec = atoi(tok);
+      /* Fourth/Third column: Time hh:mm[:ss] */
+      tok = strtok (NULL, " ");
+      hour = min = sec = 0;
+      p = tok;
+      hour = atoi (p);
+      for (; *p && *p != ':'; ++p);
+      if (*p)
+       min = atoi (++p);
+      for (; *p && *p != ':'; ++p);
+      if (*p)
+       sec = atoi (++p);
 
       DEBUGP(("YYYY/MM/DD HH:MM:SS - %d/%02d/%02d %02d:%02d:%02d\n", 
               year+1900, month, day, hour, min, sec));