1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

Only remove .listing if it has been created.

This commit is contained in:
Micah Cowan 2008-04-22 22:28:53 -07:00
parent d6bd8516dc
commit 8896339e8d
2 changed files with 15 additions and 8 deletions

View File

@ -1,3 +1,8 @@
2008-04-22 Rabin Vincent <rabin@rab.in>
* ftp.c (ftp_get_listing): Only remove .listing if it has been
created.
2008-04-22 Alain Guibert <alguibert+bts@free.fr> 2008-04-22 Alain Guibert <alguibert+bts@free.fr>
* test.h (mu_run_test): Move declaration before statements, for * test.h (mu_run_test): Move declaration before statements, for

View File

@ -1325,9 +1325,8 @@ ftp_get_listing (struct url *u, ccon *con, struct fileinfo **f)
con->target = old_target; con->target = old_target;
if (err == RETROK) if (err == RETROK)
{
*f = ftp_parse_ls (lf, con->rs); *f = ftp_parse_ls (lf, con->rs);
else
*f = NULL;
if (opt.remove_listing) if (opt.remove_listing)
{ {
if (unlink (lf)) if (unlink (lf))
@ -1335,6 +1334,9 @@ ftp_get_listing (struct url *u, ccon *con, struct fileinfo **f)
else else
logprintf (LOG_VERBOSE, _("Removed `%s'.\n"), lf); logprintf (LOG_VERBOSE, _("Removed `%s'.\n"), lf);
} }
}
else
*f = NULL;
xfree (lf); xfree (lf);
con->cmd &= ~DO_LIST; con->cmd &= ~DO_LIST;
return err; return err;