Reverse out some of the previous commit I did, which shortened the
finger output from 80 to 79 characters to stop the syscons every-second-line-is-blank problem. Also, redo the TTY column mod so that it steals one of the (usually) two blank spaces from the before the tty column rather than from the office phone number. This means the office phone field width in the short finger is back to 15 characters instead of 13.
This commit is contained in:
parent
78aea1ad2e
commit
040dbb8899
@ -59,7 +59,7 @@ sflag_print()
|
||||
extern int oflag;
|
||||
register PERSON *pn;
|
||||
register WHERE *w;
|
||||
register int sflag, r;
|
||||
register int sflag, r, namelen;
|
||||
char p[80];
|
||||
DBT data, key;
|
||||
|
||||
@ -80,9 +80,9 @@ sflag_print()
|
||||
* remote host
|
||||
*/
|
||||
#define MAXREALNAME 20
|
||||
#define MAXHOSTNAME 18 /* in reality, hosts are not longer than 16 */
|
||||
(void)printf("%-*s %-*s %s %s\n", UT_NAMESIZE, "Login", MAXREALNAME,
|
||||
"Name", "TTY Idle Login Time",
|
||||
#define MAXHOSTNAME 20 /* in reality, hosts are never longer than 16 */
|
||||
(void)printf("%-*s %-*s%s %s\n", UT_NAMESIZE, "Login", MAXREALNAME,
|
||||
"Name", " TTY Idle Login Time",
|
||||
oflag ? " Office Office Phone" : " Where");
|
||||
|
||||
for (sflag = R_FIRST;; sflag = R_NEXT) {
|
||||
@ -94,9 +94,12 @@ sflag_print()
|
||||
pn = *(PERSON **)data.data;
|
||||
|
||||
for (w = pn->whead; w != NULL; w = w->next) {
|
||||
(void)printf("%-*.*s %-*.*s ", UT_NAMESIZE, UT_NAMESIZE,
|
||||
pn->name, MAXREALNAME, MAXREALNAME,
|
||||
pn->realname ? pn->realname : "");
|
||||
namelen = MAXREALNAME;
|
||||
if (w->info == LOGGEDIN && !w->writable)
|
||||
--namelen; /* leave space before `*' */
|
||||
(void)printf("%-*.*s %-*.*s", UT_NAMESIZE, UT_NAMESIZE,
|
||||
pn->name, MAXREALNAME, namelen,
|
||||
pn->realname ? pn->realname : "");
|
||||
if (!w->loginat) {
|
||||
(void)printf(" * * No logins ");
|
||||
goto office;
|
||||
@ -133,7 +136,7 @@ office: if (oflag) {
|
||||
else if (pn->officephone)
|
||||
(void)printf(" %-10.10s", " ");
|
||||
if (pn->officephone)
|
||||
(void)printf(" %-.13s",
|
||||
(void)printf(" %-.15s",
|
||||
prphone(pn->officephone));
|
||||
} else
|
||||
(void)printf(" %.*s", MAXHOSTNAME, w->host);
|
||||
|
Loading…
x
Reference in New Issue
Block a user