Fri 19 Nov 2010 04:16:26 PM UTC, comment #8:
thanks for the clarification.
I have committed this patch:
=== modified file 'src/ftp.c'
--- src/ftp.c 2010-10-11 20:49:14 +0000
+++ src/ftp.c 2010-11-19 15:36:32 +0000
@@ -241,7 +241,7 @@
and closes the control connection in case of error. */
static uerr_t
getftp (struct url u, wgint passed_expected_bytes, wgint qtyread,
- wgint restval, ccon *con)
+ wgint restval, ccon *con, int count)
{
int csock, dtsock, local_sock, res;
uerr_t err = RETROK; /* appease the compiler */
@@ -1172,7 +1172,7 @@
#endif /* def __VMS [else] */
}
else if (opt.noclobber || opt.always_rest || opt.timestamping || opt.dirstruct
- || opt.output_document)
+ || opt.output_document || count > 0)
{
if (opt.unlink && file_exists_p (con->target))
{
@@ -1488,7 +1488,7 @@
len = f->size;
else
len = 0;
- err = getftp (u, len, &qtyread, restval, con);
+ err = getftp (u, len, &qtyread, restval, con, count);
if (con->csock == -1)
con->st &= ~DONE_CWD;
=== modified file 'src/http.c'
--- src/http.c 2010-10-16 01:04:25 +0000
+++ src/http.c 2010-11-19 15:41:34 +0000
@@ -1494,7 +1494,7 @@
server, and u->url will be requested. */
static uerr_t
gethttp (struct url u, struct http_stat hs, int dt, struct url proxy,
- struct iri *iri)
+ struct iri *iri, int count)
{
struct request *req;
@@ -2479,7 +2479,7 @@
fp = fopen (hs->local_file, "ab");
#endif /* def __VMS [else] */
}
- else if (ALLOW_CLOBBER)
+ else if (ALLOW_CLOBBER || count > 0)
{
if (opt.unlink && file_exists_p (hs->local_file))
{
@@ -2756,7 +2756,7 @@
*dt &= ~SEND_NOCACHE;
/* Try fetching the document, or at least its head. */
- err = gethttp (u, &hstat, dt, proxy, iri);
+ err = gethttp (u, &hstat, dt, proxy, iri, count);
/* Time? */
tms = datetime_str (time (NULL));
|