mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Don't delete an input file fetched via FTP.
This commit is contained in:
parent
33d8b23dfd
commit
a801efcd96
@ -1,3 +1,12 @@
|
||||
2010-03-04 Steven Schubiger <stsc@member.fsf.org>
|
||||
|
||||
* ftp.c (ftp_loop_internal): Omit input file from being
|
||||
deleted after retrieval.
|
||||
|
||||
* retr.c (input_file_url): New function.
|
||||
|
||||
* retr.h: Add declaration for input_file_url.
|
||||
|
||||
2010-03-02 Steven Schubiger <stsc@member.fsf.org>
|
||||
|
||||
* retr.c (retrieve_from_file): Improve checking for a URL
|
||||
|
@ -1561,7 +1561,7 @@ ftp_loop_internal (struct url *u, struct fileinfo *f, ccon *con, char **local_fi
|
||||
total_downloaded_bytes += qtyread;
|
||||
numurls++;
|
||||
|
||||
if (opt.delete_after)
|
||||
if (opt.delete_after && !input_file_url (opt.input_filename))
|
||||
{
|
||||
DEBUGP (("\
|
||||
Removing file due to --delete-after in ftp_loop_internal():\n"));
|
||||
|
17
src/retr.c
17
src/retr.c
@ -1189,3 +1189,20 @@ set_local_file (const char **file, const char *default_file)
|
||||
else
|
||||
*file = default_file;
|
||||
}
|
||||
|
||||
/* Return true for an input file's own URL, false otherwise. */
|
||||
bool
|
||||
input_file_url (const char *input_file)
|
||||
{
|
||||
static bool first = true;
|
||||
|
||||
if (input_file
|
||||
&& url_has_scheme (input_file)
|
||||
&& first)
|
||||
{
|
||||
first = false;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
@ -69,4 +69,6 @@ bool url_uses_proxy (struct url *);
|
||||
|
||||
void set_local_file (const char **, const char *);
|
||||
|
||||
bool input_file_url (const char *);
|
||||
|
||||
#endif /* RETR_H */
|
||||
|
Loading…
Reference in New Issue
Block a user