From: Nikolay Merinov Date: Wed, 3 Oct 2012 15:31:25 +0000 (+0600) Subject: Recieve ftp listing even when .listing file exist and --no-clobber option is given. X-Git-Tag: v1.15~88 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=13c6e7832ab5b369e4fd01fbde1b12945e8d7cbd Recieve ftp listing even when .listing file exist and --no-clobber option is given. --- diff --git a/src/ChangeLog b/src/ChangeLog index 13f75296..b1bcff48 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-10-03 Merinov Nikolay + + * ftp.c (ftp_loop_internal): Ignore --no-clobber option when + receiving directory listing. + 2012-10-07 Tim Ruehsen Giuseppe Scrivano diff --git a/src/ftp.c b/src/ftp.c index 669e6637..b585631f 100644 --- a/src/ftp.c +++ b/src/ftp.c @@ -1424,7 +1424,12 @@ ftp_loop_internal (struct url *u, struct fileinfo *f, ccon *con, char **local_fi /* If the output_document was given, then this check was already done and the file didn't exist. Hence the !opt.output_document */ - if (opt.noclobber && !opt.output_document && file_exists_p (con->target)) + + /* If we receive .listing file it is necessary to determine system type of the ftp + server even if opn.noclobber is given. Thus we must ignore opt.noclobber in + order to establish connection with the server and get system type. */ + if (opt.noclobber && !opt.output_document && file_exists_p (con->target) + && !((con->cmd & DO_LIST) && !(con->cmd & DO_RETR))) { logprintf (LOG_VERBOSE, _("File %s already there; not retrieving.\n"), quote (con->target));