]> sjero.net Git - wget/blobdiff - src/ftp.c
Merging my botched import with Alex's original commit.
[wget] / src / ftp.c
index ff5c1e72f896e7e1b028369264868396f1dd8123..0321032168487d2eff9b66a13de03595b531ae4a 100644 (file)
--- a/src/ftp.c
+++ b/src/ftp.c
@@ -1,6 +1,6 @@
 /* File Transfer Protocol support.
    Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-   2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+   2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 This file is part of GNU Wget.
 
@@ -918,7 +918,7 @@ Error in server response, closing control connection.\n"));
       if (opt.backups)
         rotate_backups (con->target);
 
-      if (restval)
+      if (restval && !(con->cmd & DO_LIST))
         fp = fopen (con->target, "ab");
       else if (opt.noclobber || opt.always_rest || opt.timestamping || opt.dirstruct
                || opt.output_document)
@@ -1141,7 +1141,9 @@ ftp_loop_internal (struct url *u, struct fileinfo *f, ccon *con)
         }
 
       /* Decide whether or not to restart.  */
-      if (opt.always_rest
+      if (con->cmd & DO_LIST)
+        restval = 0;
+      else if (opt.always_rest
           && stat (locf, &st) == 0
           && S_ISREG (st.st_mode))
         /* When -c is used, continue from on-disk size.  (Can't use