diff options
author | Jim Meyering <meyering@redhat.com> | 2008-07-04 16:34:39 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2008-07-04 16:34:39 +0200 |
commit | 63467fa18794f02497c7a46e3b7783ba1180f8fc (patch) | |
tree | 687d7d03270599416cd6817b688e79cdbff16b25 | |
parent | 5483165b129b1ace218cb20d1a75ddff6ed45488 (diff) | |
download | coreutils-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; } |