From 9d5b9daf06153f06e46d5c3057993a0195c055e4 Mon Sep 17 00:00:00 2001 From: Micah Cowan Date: Fri, 11 Apr 2008 16:28:24 -0700 Subject: [PATCH] Don't append to an existing .listing when --continue is used. Fixes bug #22825. --- doc/ChangeLog | 5 +++++ doc/wget.texi | 3 +++ src/ChangeLog | 7 +++++++ src/ftp.c | 6 ++++-- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 343f09f7..c5614d4a 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2008-04-11 Micah Cowan + + * wget.texi : Added Julien Buty, Alexander + Dergachev, and Rabin Vincent. + 2008-03-24 Micah Cowan * wget.texi : Mentioned various caveats in the diff --git a/doc/wget.texi b/doc/wget.texi index cd97bcf0..583c7fcf 100644 --- a/doc/wget.texi +++ b/doc/wget.texi @@ -3770,6 +3770,7 @@ Paul Bludov, Daniel Bodea, Mark Boyns, John Burden, +Julien Buty, Wanderlei Cavassin, Gilles Cedoc, Tim Charron, @@ -3785,6 +3786,7 @@ Andreas Damm, Ahmon Dancy, Andrew Davison, Bertrand Demiddelaer, +Alexander Dergachev, Andrew Deryabin, Ulrich Drepper, Marc Duponcheel, @@ -3938,6 +3940,7 @@ Philipp Thomas, Mauro Tortonesi, Dave Turner, Gisle Vanem, +Rabin Vincent, Russell Vincent, @iftex @v{Z}eljko Vrba, diff --git a/src/ChangeLog b/src/ChangeLog index fddcefd4..23a422d7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -4,6 +4,13 @@ "unknown" value for the attempted allocation size. * utils.c (aprintf): Now calls memfatal, instead of aborting. +2008-04-11 Micah Cowan + + * ftp.c (getftp, ftp_loop_internal): Don't append to an existing + .listing when --continue is used. Fixes bug #22825. Thanks to + Rabin Vincent for pointing the way with a + suggested fix! + 2008-03-19 Micah Cowan * utils.c (test_dir_matches_p): More tests related for diff --git a/src/ftp.c b/src/ftp.c index 115cc5c4..03210321 100644 --- a/src/ftp.c +++ b/src/ftp.c @@ -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