[2135] in Athena Bugs
4.3 Tahoe w(1) and uptime(1) bug
daemon@ATHENA.MIT.EDU (Jonathan I. Kamens)
Sun Apr 30 07:08:21 1989
Date: Sun, 30 Apr 89 07:06:41 EDT
From: Jonathan I. Kamens <jik@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU, bugs@berkeley.edu
The following bug is present in 4.3 and 4.3 Tahoe code for the w (and
uptime, since they're the same binary) programs.
SYNOPSIS:
When the program prints out the number of users, it tries to
decide whether to use "users" or "user" by checking if the
number of users is greater than one. As a result, if the
number of users is zero it will say "0 user," which is
incorrect. It should say "0 users."
FIX:
Apply the following context diff patch to w.c.
---cut here---
*** w.c.orig Sun Apr 30 07:01:09 1989
--- w.c Sun Apr 30 07:00:35 1989
***************
*** 246,252 ****
nusers++;
}
rewind(ut);
! printf(" %d user%s", nusers, nusers>1?"s":"");
/*
* Print 1, 5, and 15 minute load averages.
--- 246,252 ----
nusers++;
}
rewind(ut);
! printf(" %d user%s", nusers, ((nusers == 1) ? "" : "s"));
/*
* Print 1, 5, and 15 minute load averages.
---cut here---
Jonathan Kamens USnail:
MIT Project Athena 410 Memorial Drive, No. 223F
jik@Athena.MIT.EDU Cambridge, MA 02139-4318
Office: 617-253-4261 Home: 617-225-8218