diff options
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/fetch/ftp.c | 4 | ||||
-rw-r--r-- | usr.bin/fetch/main.c | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/fetch/ftp.c b/usr.bin/fetch/ftp.c index 0960b81..1b8e0fe 100644 --- a/usr.bin/fetch/ftp.c +++ b/usr.bin/fetch/ftp.c @@ -26,7 +26,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ftp.c,v 1.1 1997/01/30 21:43:40 wollman Exp $ + * $Id: ftp.c,v 1.2 1997/02/05 19:59:12 wollman Exp $ */ #include <sys/types.h> @@ -327,7 +327,7 @@ ftp_retrieve(struct fetch_state *fs) } if (fs->fs_restart) { if (stab.st_size != 0 && stab.st_size < size) - seekloc = wehave = size; + seekloc = wehave = stab.st_size; } } diff --git a/usr.bin/fetch/main.c b/usr.bin/fetch/main.c index 1b899a2..2aa7b9e 100644 --- a/usr.bin/fetch/main.c +++ b/usr.bin/fetch/main.c @@ -73,7 +73,7 @@ main(int argc, char *const *argv) fs.fs_verbose = 1; change_to_dir = file_to_get = hostname = 0; - while ((c = getopt(argc, argv, "ac:D:f:h:HilLmMnNo:pPqrT:vV:")) != -1) { + while ((c = getopt(argc, argv, "ac:D:f:h:HilLmMnNo:pPqRrT:vV:")) != -1) { switch (c) { case 'D': case 'H': case 'I': case 'N': case 'L': case 'V': break; /* ncftp compatibility */ @@ -286,6 +286,7 @@ void display(struct fetch_state *fs, off_t size, ssize_t n) { static off_t bytes; + static off_t bytestart; static int pr, init = 0; static struct timeval t0, t_start; static char *s; @@ -309,7 +310,7 @@ display(struct fetch_state *fs, off_t size, ssize_t n) sprintf (s, "Receiving %s", fs->fs_outputfile); printf ("%s", s); fflush (stdout); - bytes = n; + bytestart = bytes = n; return; } gettimeofday(&t, &tz); @@ -318,6 +319,7 @@ display(struct fetch_state *fs, off_t size, ssize_t n) printf ("\r%s: 100%%", s); else printf ("\r%s: %qd Kbytes", s, (quad_t)bytes/1024); + bytes -= bytestart; d = t.tv_sec + t.tv_usec/1.e6 - t_start.tv_sec - t_start.tv_usec/1.e6; printf ("\n%qd bytes transfered in %.1f seconds", (quad_t)bytes, d); d = bytes/d; |