X-Git-Url: http://sjero.net/git/?a=blobdiff_plain;f=src%2Fftp.c;h=171a38a44325a373f11c91cb659667226450f372;hb=766df9d4e9392045a4e5c730ed81e599b509557a;hp=7c5093770e11ee6c1fe9e42c59f51041ef01324a;hpb=42253233c3cb508c3ba9cd2ca0afea14e02d11b6;p=wget diff --git a/src/ftp.c b/src/ftp.c index 7c509377..171a38a4 100644 --- a/src/ftp.c +++ b/src/ftp.c @@ -1370,8 +1370,11 @@ ftp_get_listing (struct url *u, ccon *con, struct fileinfo **f) xfree (uf); DEBUGP ((_("Using %s as listing tmp file.\n"), quote (lf))); - con->target = lf; + con->target = xstrdup (lf); + xfree (lf); err = ftp_loop_internal (u, NULL, con); + lf = xstrdup (con->target); + xfree (con->target); con->target = old_target; if (err == RETROK) @@ -1590,16 +1593,8 @@ Already have correct symlink %s -> %s\n\n"), && dlthis && file_exists_p (con->target)) { - /* #### This code repeats in http.c and ftp.c. Move it to a - function! */ const char *fl = NULL; - if (opt.output_document) - { - if (output_stream_regular) - fl = opt.output_document; - } - else - fl = con->target; + set_local_file (&fl, con->target); if (fl) touch (fl, f->tstamp); }