]> sjero.net Git - wget/blobdiff - src/ftp-ls.c
Use hash_table_get instead of hash_table_get_pair.
[wget] / src / ftp-ls.c
index 8fb210644d7719a4af6383742ef435b0f1da7d0d..40c11f3930f51aa6e67ed75dc29c236169880710 100644 (file)
@@ -1,6 +1,7 @@
 /* Parsing FTP `ls' output.
    Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-   2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+   2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
+   Inc.
 
 This file is part of GNU Wget.
 
@@ -33,9 +34,7 @@ as that of the covered work.  */
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
 #include <errno.h>
 #include <time.h>
 #include "utils.h"
@@ -456,7 +455,7 @@ ftp_parse_winnt_ls (const char *file)
          column 39 of the listing. This way we could also recognize
          filenames that begin with a series of space characters (but who
          really wants to use such filenames anyway?). */
-      if (len < 40) continue;
+      if (len < 40) goto continue_loop;
       tok = line + 39;
       cur.name = xstrdup(tok);
       DEBUGP (("Name: '%s'\n", cur.name));
@@ -464,14 +463,14 @@ ftp_parse_winnt_ls (const char *file)
       /* First column: mm-dd-yy. Should atoi() on the month fail, january
          will be assumed.  */
       tok = strtok(line, "-");
-      if (tok == NULL) continue;
+      if (tok == NULL) goto continue_loop;
       month = atoi(tok) - 1;
       if (month < 0) month = 0;
       tok = strtok(NULL, "-");
-      if (tok == NULL) continue;
+      if (tok == NULL) goto continue_loop;
       day = atoi(tok);
       tok = strtok(NULL, " ");
-      if (tok == NULL) continue;
+      if (tok == NULL) goto continue_loop;
       year = atoi(tok);
       /* Assuming the epoch starting at 1.1.1970 */
       if (year <= 70) year += 100;
@@ -479,10 +478,10 @@ ftp_parse_winnt_ls (const char *file)
       /* Second column: hh:mm[AP]M, listing does not contain value for
          seconds */
       tok = strtok(NULL,  ":");
-      if (tok == NULL) continue;
+      if (tok == NULL) goto continue_loop;
       hour = atoi(tok);
       tok = strtok(NULL,  "M");
-      if (tok == NULL) continue;
+      if (tok == NULL) goto continue_loop;
       min = atoi(tok);
       /* Adjust hour from AM/PM. Just for the record, the sequence goes
          11:00AM, 12:00PM, 01:00PM ... 11:00PM, 12:00AM, 01:00AM . */
@@ -513,9 +512,9 @@ ftp_parse_winnt_ls (const char *file)
          directories as the listing does not give us a clue) and filetype
          here. */
       tok = strtok(NULL, " ");
-      if (tok == NULL) continue;
+      if (tok == NULL) goto continue_loop;
       while ((tok != NULL) && (*tok == '\0'))  tok = strtok(NULL, " ");
-      if (tok == NULL) continue;
+      if (tok == NULL) goto continue_loop;
       if (*tok == '<')
         {
           cur.type  = FT_DIRECTORY;
@@ -555,6 +554,7 @@ ftp_parse_winnt_ls (const char *file)
           l->next = NULL;
         }
 
+continue_loop:
       xfree (line);
     }