summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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