diff options
author | 2000-04-16 04:47:43 +0000 | |
---|---|---|
committer | 2000-04-16 04:47:43 +0000 | |
commit | f84ec0d950a123d5ff9043ec2ca3c01af40ea008 (patch) | |
tree | 6864714f809ef36340b9ee1dda72cbb91277da92 /usr.bin/ssh | |
parent | Fix this for the case where the file is a device - make sure we don't (diff) | |
download | wireguard-openbsd-f84ec0d950a123d5ff9043ec2ca3c01af40ea008.tar.xz wireguard-openbsd-f84ec0d950a123d5ff9043ec2ca3c01af40ea008.zip |
after completion, replace the progress bar ETA counter with a final elapsed time; my idea, aaron wrote the patch
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r-- | usr.bin/ssh/scp.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.bin/ssh/scp.c b/usr.bin/ssh/scp.c index 8fb24964df2..03618f634ef 100644 --- a/usr.bin/ssh/scp.c +++ b/usr.bin/ssh/scp.c @@ -45,7 +45,7 @@ */ #include "includes.h" -RCSID("$Id: scp.c,v 1.27 2000/04/14 10:30:32 markus Exp $"); +RCSID("$Id: scp.c,v 1.28 2000/04/16 04:47:43 deraadt Exp $"); #include "ssh.h" #include "xmalloc.h" @@ -1006,7 +1006,7 @@ run_err(const char *fmt,...) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scp.c,v 1.27 2000/04/14 10:30:32 markus Exp $ + * $Id: scp.c,v 1.28 2000/04/16 04:47:43 deraadt Exp $ */ char * @@ -1209,7 +1209,12 @@ progressmeter(int flag) snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " - stalled -"); } else { - remaining = (int) (totalbytes / (statbytes / elapsed) - elapsed); + if (flag != 1) + remaining = + (int)(totalbytes / (statbytes / elapsed) - elapsed); + else + remaining = elapsed; + i = remaining / 3600; if (i) snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), @@ -1219,7 +1224,8 @@ progressmeter(int flag) " "); i = remaining % 3600; snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), - "%02d:%02d ETA", i / 60, i % 60); + "%02d:%02d%s", i / 60, i % 60, + (flag != 1) ? " ETA" : " "); } atomicio(write, fileno(stdout), buf, strlen(buf)); |