From: Micah Cowan Date: Sun, 3 Feb 2008 20:20:52 +0000 (-0800) Subject: Ugly fix to make -nc without --content-disposition go back to not fetching files. X-Git-Tag: v1.13~458 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=c1b7382ec4c25c23c81a0e0964d94fff72c6a633 Ugly fix to make -nc without --content-disposition go back to not fetching files. --- diff --git a/src/ChangeLog b/src/ChangeLog index 7be1d9a2..caeb3b77 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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 diff --git a/src/http.c b/src/http.c index da4b32e3..02645724 100644 --- a/src/http.c +++ b/src/http.c @@ -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;