]> sjero.net Git - wget/commitdiff
[svn] Correctly loop through the linked list.
authorhniksic <devnull@localhost>
Tue, 14 Oct 2003 22:52:12 +0000 (15:52 -0700)
committerhniksic <devnull@localhost>
Tue, 14 Oct 2003 22:52:12 +0000 (15:52 -0700)
By Philip Stadermann.

src/ChangeLog
src/ftp.c

index 1dcca90ed232df51aa511b5109e2cd178b6d38f0..1c94f771252fdd80614f1edbd802d2378cfa6b9b 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-15  Philip Stadermann  <philip.stadermann@credativ.de>
+
+       * ftp.c (ftp_retrieve_glob): Correctly loop through the list whose
+       elements might have been deleted.
+
 2003-10-13  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * html-url.c (tag_handle_meta): Set the Refresh link to expect
index 5a84a9d8ca311022567106f7dc0e8578beb581a3..7e997393204a1df915b215b4a11331eae333fbcc 100644 (file)
--- a/src/ftp.c
+++ b/src/ftp.c
@@ -1618,20 +1618,19 @@ has_insecure_name_p (const char *s)
 static uerr_t
 ftp_retrieve_glob (struct url *u, ccon *con, int action)
 {
-  struct fileinfo *f, *orig, *start;
+  struct fileinfo *f, *start;
   uerr_t res;
 
   con->cmd |= LEAVE_PENDING;
 
-  res = ftp_get_listing (u, con, &orig);
+  res = ftp_get_listing (u, con, &start);
   if (res != RETROK)
     return res;
-  start = orig;
   /* First: weed out that do not conform the global rules given in
      opt.accepts and opt.rejects.  */
   if (opt.accepts || opt.rejects)
     {
-      f = orig;
+      f = start;
       while (f)
        {
          if (f->type != FT_DIRECTORY && !acceptable (f->name))
@@ -1644,7 +1643,7 @@ ftp_retrieve_glob (struct url *u, ccon *con, int action)
        }
     }
   /* Remove all files with possible harmful names */
-  f = orig;
+  f = start;
   while (f)
     {
       if (has_insecure_name_p (f->name))