Date: Thu, 16 Apr 1998 11:10:51 -0700 (PDT) From: pete@altadena.net To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: bin/6325: Heading fix for 'w' on long-name systems Message-ID: <199804161810.LAA14989@ns.altadena.net>
next in thread | raw e-mail | index | archive | help
>Number: 6325
>Category: bin
>Synopsis: Heading fix for 'w' on long-name systems
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Thu Apr 16 11:20:01 PDT 1998
>Last-Modified:
>Originator: Pete Carah
>Organization:
Altadena Internet Communications
>Release: FreeBSD 2.2.6-STABLE i386
>Environment:
Any system based on 2.x which has been recompiled for user
names longer than 8 characters
>Description:
w adjusted the user-name size for detail lines but not the
header. Enclosed diff fixes this. (this should apply against
any 2.x-stable; may alsp apply to -current (I haven't looked
to see if it has been fixed there))
>How-To-Repeat:
w
(on any 2.x system with usernames > 8 chars)
>Fix:
*** w.c.orig Tue Apr 14 09:52:43 1998
--- w.c Tue Apr 14 09:56:11 1998
***************
*** 245,253 ****
if (wcmd == 0)
exit (0);
! #define HEADER "USER TTY FROM LOGIN@ IDLE WHAT\n"
! #define WUSED (sizeof (HEADER) - sizeof ("WHAT\n"))
! (void)printf(HEADER);
}
if ((kp = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nentries)) == NULL)
--- 245,256 ----
if (wcmd == 0)
exit (0);
! #define HEADER1 "USER"
! #define HEADER2 "TTY FROM LOGIN@ IDLE WHAT\n"
! #define WUSED (sizeof (HEADER1) + sizeof(HEADER2) + 1 + UT_NAMESIZE - \
! sizeof ("WHAT\n"))
! (void)printf("%-*.*s %s", UT_NAMESIZE, UT_NAMESIZE, HEADER1,
! HEADER2);
}
if ((kp = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nentries)) == NULL)
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804161810.LAA14989>
