summaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-04-19 16:26:12 +1000
committerDamien Miller <djm@mindrot.org>2000-04-19 16:26:12 +1000
commit8bb73be04e3e38be582c4b3843c765aab74017c2 (patch)
tree2050fbf49e4e94a9cef9bbe557787298111eb886 /scp.c
parent71795160ee9dbf15633b2c27679df62c11f79aaa (diff)
- OpenBSD CVS updates
[channels.c] - fix pr 1196, listen_port and port_to_connect interchanged [scp.c] - after completion, replace the progress bar ETA counter with a final elapsed time; my idea, aaron wrote the patch [ssh_config sshd_config] - show 'Protocol' as an example, ok markus@ [sshd.c] - missing xfree() - Add missing header to bsd-misc.c
Diffstat (limited to 'scp.c')
-rw-r--r--scp.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/scp.c b/scp.c
index 2bd3ed2bd..64869f976 100644
--- a/scp.c
+++ b/scp.c
@@ -45,7 +45,7 @@
45 */ 45 */
46 46
47#include "includes.h" 47#include "includes.h"
48RCSID("$Id: scp.c,v 1.19 2000/04/16 01:18:45 damien Exp $"); 48RCSID("$Id: scp.c,v 1.20 2000/04/19 06:26:14 damien Exp $");
49 49
50#include "ssh.h" 50#include "ssh.h"
51#include "xmalloc.h" 51#include "xmalloc.h"
@@ -1008,7 +1008,7 @@ run_err(const char *fmt,...)
1008 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1008 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
1009 * SUCH DAMAGE. 1009 * SUCH DAMAGE.
1010 * 1010 *
1011 * $Id: scp.c,v 1.19 2000/04/16 01:18:45 damien Exp $ 1011 * $Id: scp.c,v 1.20 2000/04/19 06:26:14 damien Exp $
1012 */ 1012 */
1013 1013
1014char * 1014char *
@@ -1211,7 +1211,12 @@ progressmeter(int flag)
1211 snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), 1211 snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
1212 " - stalled -"); 1212 " - stalled -");
1213 } else { 1213 } else {
1214 remaining = (int) (totalbytes / (statbytes / elapsed) - elapsed); 1214 if (flag != 1)
1215 remaining =
1216 (int)(totalbytes / (statbytes / elapsed) - elapsed);
1217 else
1218 remaining = elapsed;
1219
1215 i = remaining / 3600; 1220 i = remaining / 3600;
1216 if (i) 1221 if (i)
1217 snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), 1222 snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
@@ -1221,7 +1226,8 @@ progressmeter(int flag)
1221 " "); 1226 " ");
1222 i = remaining % 3600; 1227 i = remaining % 3600;
1223 snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), 1228 snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
1224 "%02d:%02d ETA", i / 60, i % 60); 1229 "%02d:%02d%s", i / 60, i % 60,
1230 (flag != 1) ? " ETA" : " ");
1225 } 1231 }
1226 atomicio(write, fileno(stdout), buf, strlen(buf)); 1232 atomicio(write, fileno(stdout), buf, strlen(buf));
1227 1233