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:
parent
d6bd8516dc
commit
8896339e8d
@ -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>
|
||||
|
||||
* test.h (mu_run_test): Move declaration before statements, for
|
||||
|
18
src/ftp.c
18
src/ftp.c
@ -1325,16 +1325,18 @@ ftp_get_listing (struct url *u, ccon *con, struct fileinfo **f)
|
||||
con->target = old_target;
|
||||
|
||||
if (err == RETROK)
|
||||
*f = ftp_parse_ls (lf, con->rs);
|
||||
{
|
||||
*f = ftp_parse_ls (lf, con->rs);
|
||||
if (opt.remove_listing)
|
||||
{
|
||||
if (unlink (lf))
|
||||
logprintf (LOG_NOTQUIET, "unlink: %s\n", strerror (errno));
|
||||
else
|
||||
logprintf (LOG_VERBOSE, _("Removed `%s'.\n"), lf);
|
||||
}
|
||||
}
|
||||
else
|
||||
*f = NULL;
|
||||
if (opt.remove_listing)
|
||||
{
|
||||
if (unlink (lf))
|
||||
logprintf (LOG_NOTQUIET, "unlink: %s\n", strerror (errno));
|
||||
else
|
||||
logprintf (LOG_VERBOSE, _("Removed `%s'.\n"), lf);
|
||||
}
|
||||
xfree (lf);
|
||||
con->cmd &= ~DO_LIST;
|
||||
return err;
|
||||
|
Loading…
Reference in New Issue
Block a user