Subject: bin/6131: finger: print login time left justified
To: None <gnats-bugs@gnats.netbsd.org>
From: Wolfgang Helbig <helbig@Informatik.BA-Stuttgart.DE>
List: netbsd-bugs
Date: 09/09/1998 15:13:44
>Number: 6131
>Category: bin
>Synopsis: finger: print login time left justified
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people (Utility Bug People)
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Wed Sep 9 06:20:01 1998
>Last-Modified:
>Originator: Wolfgang Helbig
>Organization:
>Release: NetBSD 1.3.2
>Environment:
System: NetBSD RVC1 1.3.2 NetBSD 1.3.2 (RVC2) #0: Thu Sep 3 20:42:09 CEST 1998 helbig@RVC1:/usr/src/sys/arch/i386/compile/RVC2 i386
>Description:
The output of finger -s looks better, if the login times are
left justified -- at least to me.
>How-To-Repeat:
finger -s
>Fix:
*** /usr/src/usr.bin/finger/sprint.c.orig Wed Sep 9 13:14:10 1998
--- usr.bin/finger/sprint.c Wed Sep 9 14:24:15 1998
***************
*** 128,140 ****
(void)printf(" * ");
p = ctime(&w->loginat);
if (now - w->loginat < SECSPERDAY * (DAYSPERWEEK - 1))
! (void)printf(" %.3s", p);
else
! (void)printf("%.6s", p + 4);
! if (now - w->loginat >= SECSPERDAY * DAYSPERNYEAR / 2)
! (void)printf(" %.4s ", p + 20);
! else
! (void)printf(" %.5s", p + 11);
office:
if (gflag)
goto no_gecos;
--- 128,139 ----
(void)printf(" * ");
p = ctime(&w->loginat);
if (now - w->loginat < SECSPERDAY * (DAYSPERWEEK - 1))
! (void)printf("%.3s %-8.5s", p, p + 11);
! else if (now - w->loginat
! < SECSPERDAY * DAYSPERNYEAR / 2)
! (void)printf("%.6s %-5.5s", p + 4, p + 11);
else
! (void)printf("%.6s %-5.4s", p + 4, p + 20);
office:
if (gflag)
goto no_gecos;
>Audit-Trail:
>Unformatted: