minor cosmetic bug

James H. Cloos Jr. cloos at jhcloos.com
Sun Jul 2 12:22:33 EST 2000


The progress metre in scp(1) breaks when the tty is too wide.

This patch is the effortless fix:

###########################################################################
:; diff -u openssh-2.1.1p2/scp.c openssh-2.1.1p2+jhc/scp.c
--- openssh-2.1.1p2+jhc/scp.c   Thu Jun 22 07:32:32 2000
+++ openssh-2.1.1p2/scp.c       Sat Jul  1 22:15:36 2000
@@ -1176,8 +1176,9 @@
                i = barlength * ratio / 100;
                snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
                         "|%.*s%*s|", i,
-                        "*****************************************************************************"
-                        "*****************************************************************************",
+                        "*********************************************************************"
+                        "*********************************************************************"
+                        "*********************************************************************",
                         barlength - i, "");
        }
        i = 0;
###########################################################################

In case it numges in mail, change from two strings of 77 asterisks each to
three of 69 each.  Limiting it to 207 *s keeps the bargraph from overwriting
the octet-count and time-to-go; 210 is too many.  I didn't try 209 or 208,
prefering to keep the three strings equal in length....

-JimC
-- 
James H. Cloos, Jr.  <http://jhcloos.com/public_key>     1024D/ED7DAEA6 
<cloos at jhcloos.com>  E9E9 F828 61A4 6EA9 0F2B  63E7 997A 9F17 ED7D AEA6
     Is this post worth two cents?  Then goto <http://2cw.org/23>!





More information about the openssh-unix-dev mailing list