From 8802e34cc831f8f35c861ec16b46456240d76fe4 Mon Sep 17 00:00:00 2001 From: ache Date: Tue, 27 Sep 1994 01:00:18 +0000 Subject: idle time == 0 printed now as "-" like in good old BSD skip cua* 3 chars as tty* 3 lchars --- usr.bin/w/pr_time.c | 3 +++ usr.bin/w/w.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'usr.bin/w') diff --git a/usr.bin/w/pr_time.c b/usr.bin/w/pr_time.c index 87fffb3..73e44fa 100644 --- a/usr.bin/w/pr_time.c +++ b/usr.bin/w/pr_time.c @@ -98,6 +98,9 @@ pr_idle(idle) (void)printf(" %2d:%02d ", idle / SECSPERHOUR, (idle % SECSPERHOUR) / SECSPERMIN); + else if (idle / SECSPERMIN == 0) + (void)printf(" - "); + /* Else print the minutes idle. */ else (void)printf(" %2d ", idle / SECSPERMIN); diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c index 1a7b526..9d1e060 100644 --- a/usr.bin/w/w.c +++ b/usr.bin/w/w.c @@ -312,7 +312,8 @@ main(argc, argv) } (void)printf("%-*.*s %-2.2s %-*.*s ", UT_NAMESIZE, UT_NAMESIZE, ep->utmp.ut_name, - strncmp(ep->utmp.ut_line, "tty", 3) ? + strncmp(ep->utmp.ut_line, "tty", 3) && + strncmp(ep->utmp.ut_line, "cua", 3) ? ep->utmp.ut_line : ep->utmp.ut_line + 3, UT_HOSTSIZE, UT_HOSTSIZE, *p ? p : "-"); pr_attime(&ep->utmp.ut_time, &now); -- cgit v1.1