X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fhttp.c;h=fa83ebf5d8254dacf0c5092d83ef87547e094f59;hp=129359cad47e183a01d89ae1aeb25b32b0a6ee3e;hb=888c30ba01f2ea7fe4ba1f24b536aafe887b2c37;hpb=1ddd88d7c5c32446cc6f8ea2ec4d97eba72bfb28 diff --git a/src/http.c b/src/http.c index 129359ca..fa83ebf5 100644 --- a/src/http.c +++ b/src/http.c @@ -1821,10 +1821,11 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy) /* TODO: perform this check only once. */ if (!hs->existence_checked && file_exists_p (hs->local_file)) { - if (opt.noclobber) + if (opt.noclobber && !opt.output_document) { /* If opt.noclobber is turned on and file already exists, do not - retrieve the file */ + retrieve the file. But if the output_document was given, then this + test was already done and the file doesn't exist. Hence the !opt.output_document */ logprintf (LOG_VERBOSE, _("\ File `%s' already there; not retrieving.\n\n"), hs->local_file); /* If the file is there, we suppose it's retrieved OK. */ @@ -2374,10 +2375,11 @@ http_loop (struct url *u, char **newloc, char **local_file, const char *referer, /* 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 (got_name && file_exists_p (hstat.local_file) && opt.noclobber && !opt.output_document) { /* If opt.noclobber is turned on and file already exists, do not - retrieve the file */ + retrieve the file. But if the output_document was given, then this + test was already done and the file doesn't exist. Hence the !opt.output_document */ logprintf (LOG_VERBOSE, _("\ File `%s' already there; not retrieving.\n\n"), hstat.local_file);