summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-07-04 16:34:39 +0200
committerJim Meyering <meyering@redhat.com>2008-07-04 16:34:39 +0200
commit63467fa18794f02497c7a46e3b7783ba1180f8fc (patch)
tree687d7d03270599416cd6817b688e79cdbff16b25
parent5483165b129b1ace218cb20d1a75ddff6ed45488 (diff)
downloadcoreutils-63467fa18794f02497c7a46e3b7783ba1180f8fc.tar.xz
who -r: don't print "last=" when the corresponding byte is unprintable
* src/who.c (print_runlevel): Print last=%c only when the "preceding run-level" byte is printable. Reported by Gian Piero De Lolliis in <http://bugzilla.redhat.com/453249>.
-rw-r--r--src/who.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/who.c b/src/who.c
index 5529618d9..0bba91275 100644
--- a/src/who.c
+++ b/src/who.c
@@ -30,6 +30,7 @@
#include <sys/types.h>
#include "system.h"
+#include "c-ctype.h"
#include "canon-host.h"
#include "readutmp.h"
#include "error.h"
@@ -511,7 +512,7 @@ print_runlevel (const STRUCT_UTMP *utmp_ent)
sprintf (comment, "%s%c", _("last="), (last == 'N') ? 'S' : last);
print_line (-1, "", ' ', -1, runlevline, time_string (utmp_ent),
- "", "", comment, "");
+ "", "", c_isprint (last) ? comment : "", "");
return;
}