From 63467fa18794f02497c7a46e3b7783ba1180f8fc Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 4 Jul 2008 16:34:39 +0200 Subject: 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 . --- src/who.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/who.c') 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 #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; } -- cgit v1.2.3-54-g00ecf