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

Automated merge.

This commit is contained in:
Micah Cowan 2009-04-22 11:44:13 -07:00
commit bb2cba2cc7
4 changed files with 24 additions and 18 deletions

View File

@ -2,6 +2,15 @@
* Makefile.am (version.c): Fix unportable use of "echo -n".
2009-04-13 Steven Schubiger <stsc@member.fsf.org>
* ftp.c (ftp_retrieve_list): Move the duplicated code that
determines the local file to a function.
* http.c (http_loop): Likewise.
* retr.c (set_local_file): New function.
2009-04-11 Steven Schubiger <stsc@member.fsf.org>
* init.c (initialize): Run a custom SYSTEM_WGETRC when

View File

@ -1590,16 +1590,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);
}

View File

@ -2723,16 +2723,8 @@ Remote file exists.\n\n"));
&& ((hstat.len == hstat.contlen) ||
((hstat.res == 0) && (hstat.contlen == -1))))
{
/* #### 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 = hstat.local_file;
set_local_file (&fl, hstat.local_file);
if (fl)
{
time_t newtmr = -1;

View File

@ -1070,3 +1070,16 @@ no_proxy_match (const char *host, const char **no_proxy)
else
return sufmatch (no_proxy, host);
}
/* Set the file parameter to point to the local file string. */
void
set_local_file (const char **file, const char *default_file)
{
if (opt.output_document)
{
if (output_stream_regular)
*file = opt.output_document;
}
else
*file = default_file;
}