diff --git a/src/http.c b/src/http.c index bc2cfd09..1c5e99d8 100644 --- a/src/http.c +++ b/src/http.c @@ -3513,7 +3513,7 @@ Remote file exists.\n\n")); if (hstat.len == hstat.contlen) { - if (*dt & RETROKF) + if (*dt & RETROKF || opt.content_on_error) { bool write_to_stdout = (opt.output_document && HYPHENP (opt.output_document)); @@ -3549,7 +3549,7 @@ Remote file exists.\n\n")); if (hstat.contlen == -1) /* We don't know how much we were supposed to get, so assume we succeeded. */ { - if (*dt & RETROKF) + if (*dt & RETROKF || opt.content_on_error) { bool write_to_stdout = (opt.output_document && HYPHENP (opt.output_document)); @@ -3627,7 +3627,7 @@ Remote file exists.\n\n")); while (!opt.ntry || (count < opt.ntry)); exit: - if (ret == RETROK && local_file) + if ((ret == RETROK || opt.content_on_error) && local_file) { xfree (*local_file); *local_file = xstrdup (hstat.local_file); diff --git a/src/retr.c b/src/retr.c index f12c50fb..d8626dbc 100644 --- a/src/retr.c +++ b/src/retr.c @@ -941,7 +941,7 @@ retrieve_url (struct url * orig_parsed, const char *origurl, char **file, DEBUGP (("[Couldn't fallback to non-utf8 for %s\n", quote (url))); } - if (local_file && u && *dt & RETROKF) + if (local_file && u && (*dt & RETROKF || opt.content_on_error)) { register_download (u->url, local_file);