Ugly fix to make -nc without --content-disposition go back to not fetching files.

This commit is contained in:
Micah Cowan 2008-02-03 12:20:52 -08:00
parent 5dacf1191d
commit c1b7382ec4
2 changed files with 23 additions and 0 deletions

View File

@ -6,6 +6,9 @@
bugs (#22161, #20481)
(get_eta, count_cols): Added to support the changes for
create_image.
* http.c (http_loop): Put no-clobber logic back into http_loop,
before starting to fetch, for when we're not doing
content-disposition.
2008-01-31 Micah Cowan <micah@cowan.name>

View File

@ -2359,6 +2359,26 @@ http_loop (struct url *u, char **newloc, char **local_file, const char *referer,
got_name = true;
}
/* TODO: Ick! This code is now in both gethttp and http_loop, and is
* screaming for some refactoring. */
if (got_name && file_exists_p (hstat.local_file) && opt.noclobber)
{
/* If opt.noclobber is turned on and file already exists, do not
retrieve the file */
logprintf (LOG_VERBOSE, _("\
File `%s' already there; not retrieving.\n\n"),
hstat.local_file);
/* If the file is there, we suppose it's retrieved OK. */
*dt |= RETROKF;
/* #### Bogusness alert. */
/* If its suffix is "html" or "htm" or similar, assume text/html. */
if (has_html_suffix_p (hstat.local_file))
*dt |= TEXTHTML;
return RETRUNNEEDED;
}
/* Reset the counter. */
count = 0;