Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/usr.bin/netstat Pull up rev. 1.41:



details:   https://anonhg.NetBSD.org/src/rev/1f17efbfbae1
branches:  netbsd-1-5
changeset: 488411:1f17efbfbae1
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Jul 03 22:45:12 2000 +0000

description:
Pull up rev. 1.41:
with -inv flag, do not truncate name of the interface (like "strip0").

diffstat:

 usr.bin/netstat/if.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r 275cb090bc3a -r 1f17efbfbae1 usr.bin/netstat/if.c
--- a/usr.bin/netstat/if.c      Mon Jul 03 22:43:42 2000 +0000
+++ b/usr.bin/netstat/if.c      Mon Jul 03 22:45:12 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.c,v 1.40 2000/04/19 03:26:55 enami Exp $    */
+/*     $NetBSD: if.c,v 1.40.4.1 2000/07/03 22:45:12 thorpej Exp $      */
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "from: @(#)if.c 8.2 (Berkeley) 2/21/94";
 #else
-__RCSID("$NetBSD: if.c,v 1.40 2000/04/19 03:26:55 enami Exp $");
+__RCSID("$NetBSD: if.c,v 1.40.4.1 2000/07/03 22:45:12 thorpej Exp $");
 #endif
 #endif /* not lint */
 
@@ -174,7 +174,11 @@
                        *cp = '\0';
                        ifaddraddr = (u_long)ifnet.if_addrlist.tqh_first;
                }
-               printf("%-5.5s %-5llu ", name,
+               if (vflag)
+                       n = strlen(name) < 5 ? 5 : strlen(name);
+               else
+                       n = 5;
+               printf("%-*.*s %-5llu ", n, n, name,
                    (unsigned long long)ifnet.if_mtu);
                if (ifaddraddr == 0) {
                        printf("%-13.13s ", "none");



Home | Main Index | Thread Index | Old Index