summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-04-02 20:17:43 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-04-02 20:17:43 +0000
commitcdb66e0e82a3c5d80f8445a3074ee77f356dbda8 (patch)
treef210910f0d831b97c8146859bfc63779cfb33fe8
parent38c4a28a7e9911b9e3b38a6ad6c9db9cb57cc9f2 (diff)
- (bal) Hand Sync of scp.c (reverted to upstream code)
- deraadt@cvs.openbsd.org 2002/03/30 17:45:46 [scp.c] stretch banners
-rw-r--r--ChangeLog8
-rw-r--r--scp.c23
2 files changed, 18 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index fda2d506b..7ca3bd9ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
120020402
2 - (bal) Hand Sync of scp.c (reverted to upstream code)
3 - deraadt@cvs.openbsd.org 2002/03/30 17:45:46
4 [scp.c]
5 stretch banners
6
120020401 720020401
2 - (stevesk) [monitor.c] PAM should work again; will *not* work with 8 - (stevesk) [monitor.c] PAM should work again; will *not* work with
3 UsePrivilegeSeparation=yes. 9 UsePrivilegeSeparation=yes.
@@ -8104,4 +8110,4 @@
8104 - Wrote replacements for strlcpy and mkdtemp 8110 - Wrote replacements for strlcpy and mkdtemp
8105 - Released 1.0pre1 8111 - Released 1.0pre1
8106 8112
8107$Id: ChangeLog,v 1.2006 2002/04/02 03:24:56 stevesk Exp $ 8113$Id: ChangeLog,v 1.2007 2002/04/02 20:17:43 mouring Exp $
diff --git a/scp.c b/scp.c
index 83e7769d6..fcf55abde 100644
--- a/scp.c
+++ b/scp.c
@@ -75,7 +75,7 @@
75 */ 75 */
76 76
77#include "includes.h" 77#include "includes.h"
78RCSID("$OpenBSD: scp.c,v 1.86 2001/12/05 03:56:39 itojun Exp $"); 78RCSID("$OpenBSD: scp.c,v 1.87 2002/03/30 17:45:46 deraadt Exp $");
79 79
80#include "xmalloc.h" 80#include "xmalloc.h"
81#include "atomicio.h" 81#include "atomicio.h"
@@ -94,14 +94,6 @@ char *__progname;
94/* alarm() interval for updating progress meter */ 94/* alarm() interval for updating progress meter */
95#define PROGRESSTIME 1 95#define PROGRESSTIME 1
96 96
97/* Progress meter bar */
98#define BAR \
99 "************************************************************"\
100 "************************************************************"\
101 "************************************************************"\
102 "************************************************************"
103#define MAX_BARLENGTH (sizeof(BAR) - 1)
104
105/* Visual statistics about files as they are transferred. */ 97/* Visual statistics about files as they are transferred. */
106void progressmeter(int); 98void progressmeter(int);
107 99
@@ -1116,7 +1108,7 @@ progressmeter(int flag)
1116 off_t cursize, abbrevsize; 1108 off_t cursize, abbrevsize;
1117 double elapsed; 1109 double elapsed;
1118 int ratio, barlength, i, remaining; 1110 int ratio, barlength, i, remaining;
1119 char buf[256]; 1111 char buf[512];
1120 1112
1121 if (flag == -1) { 1113 if (flag == -1) {
1122 (void) gettimeofday(&start, (struct timezone *) 0); 1114 (void) gettimeofday(&start, (struct timezone *) 0);
@@ -1138,11 +1130,18 @@ progressmeter(int flag)
1138 snprintf(buf, sizeof(buf), "\r%-20.20s %3d%% ", curfile, ratio); 1130 snprintf(buf, sizeof(buf), "\r%-20.20s %3d%% ", curfile, ratio);
1139 1131
1140 barlength = getttywidth() - 51; 1132 barlength = getttywidth() - 51;
1141 barlength = (barlength <= MAX_BARLENGTH)?barlength:MAX_BARLENGTH;
1142 if (barlength > 0) { 1133 if (barlength > 0) {
1143 i = barlength * ratio / 100; 1134 i = barlength * ratio / 100;
1144 snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), 1135 snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
1145 "|%.*s%*s|", i, BAR, barlength - i, ""); 1136 "|%.*s%*s|", i,
1137 "*******************************************************"
1138 "*******************************************************"
1139 "*******************************************************"
1140 "*******************************************************"
1141 "*******************************************************"
1142 "*******************************************************"
1143 "*******************************************************",
1144 barlength - i, "");
1146 } 1145 }
1147 i = 0; 1146 i = 0;
1148 abbrevsize = cursize; 1147 abbrevsize = cursize;