summaryrefslogtreecommitdiffstats
path: root/usr.bin/w
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-09-27 01:00:18 +0000
committerache <ache@FreeBSD.org>1994-09-27 01:00:18 +0000
commit8802e34cc831f8f35c861ec16b46456240d76fe4 (patch)
treee1ea313cd114b96799ab02289de0ec5cb4806447 /usr.bin/w
parent0ac72c6208f0fb64e0c40c639987bb629df6d4bb (diff)
downloadFreeBSD-src-8802e34cc831f8f35c861ec16b46456240d76fe4.zip
FreeBSD-src-8802e34cc831f8f35c861ec16b46456240d76fe4.tar.gz
idle time == 0 printed now as "-" like in good old BSD
skip cua* 3 chars as tty* 3 lchars
Diffstat (limited to 'usr.bin/w')
-rw-r--r--usr.bin/w/pr_time.c3
-rw-r--r--usr.bin/w/w.c3
2 files changed, 5 insertions, 1 deletions
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);
OpenPOWER on IntegriCloud