]> granicus.if.org Git - procps-ng/commitdiff
w: indicate unknown host when -f is used
authorSami Kerola <kerolasa@iki.fi>
Mon, 26 Dec 2011 18:07:41 +0000 (19:07 +0100)
committerSami Kerola <kerolasa@iki.fi>
Sun, 8 Jan 2012 20:31:56 +0000 (21:31 +0100)
The option -f used too print `-' to FROM column when host was not
known. This commit changes behaviour back to what it was earlier.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
w.c

diff --git a/w.c b/w.c
index 3964e4f25db657bb3fb98907806ddbfc703ee35b..e3e9dbb02300e0e6ef8af6a6b5cf256e12b8b761 100644 (file)
--- a/w.c
+++ b/w.c
@@ -78,6 +78,8 @@ static void print_host(const char *restrict host, int len, const int fromlen)
                        fputc(*host, stdout);
                        ++width;
                } else {
+                       fputc('-', stdout);
+                       ++width;
                        break;
                }
        }