mirror of
https://github.com/mirror/wget.git
synced 2025-02-01 23:30:11 +08:00
[svn] Don't clobber the file when -c is specified and the first attempt
to retrieve the file fails.
This commit is contained in:
parent
05a000a477
commit
af7e522e91
@ -1,5 +1,7 @@
|
|||||||
2005-05-17 Hrvoje Niksic <hniksic@xemacs.org>
|
2005-05-17 Hrvoje Niksic <hniksic@xemacs.org>
|
||||||
|
|
||||||
|
* ftp.c (ftp_loop_internal): Same here.
|
||||||
|
|
||||||
* http.c (http_loop): Don't clobber the file when -c is specified
|
* http.c (http_loop): Don't clobber the file when -c is specified
|
||||||
and the first attempt to retrieve the file fails.
|
and the first attempt to retrieve the file fails.
|
||||||
|
|
||||||
|
12
src/ftp.c
12
src/ftp.c
@ -1158,13 +1158,17 @@ ftp_loop_internal (struct url *u, struct fileinfo *f, ccon *con)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Decide whether or not to restart. */
|
/* Decide whether or not to restart. */
|
||||||
restval = 0;
|
if (opt.always_rest
|
||||||
if (count > 1)
|
|
||||||
restval = len; /* start where the previous run left off */
|
|
||||||
else if (opt.always_rest
|
|
||||||
&& stat (locf, &st) == 0
|
&& stat (locf, &st) == 0
|
||||||
&& S_ISREG (st.st_mode))
|
&& S_ISREG (st.st_mode))
|
||||||
|
/* When -c is used, continue from on-disk size. (Can't use
|
||||||
|
hstat.len even if count>1 because we don't want a failed
|
||||||
|
first attempt to clobber existing data.) */
|
||||||
restval = st.st_size;
|
restval = st.st_size;
|
||||||
|
else if (count > 1)
|
||||||
|
restval = len; /* start where the previous run left off */
|
||||||
|
else
|
||||||
|
restval = 0;
|
||||||
|
|
||||||
/* Get the current time string. */
|
/* Get the current time string. */
|
||||||
tms = time_str (NULL);
|
tms = time_str (NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user