From eb288aae3223576ebe3f68f5faaa1c4fd02cb73b Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sun, 24 Apr 2011 21:32:07 +0000 Subject: Provide #h for short hostname (no domain) from Michal Mazurek. --- status.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'status.c') diff --git a/status.c b/status.c index ecf19b25..3e5c69ce 100644 --- a/status.c +++ b/status.c @@ -410,6 +410,13 @@ status_replace1(struct client *c, struct session *s, struct winlink *wl, fatal("gethostname failed"); ptr = tmp; goto do_replace; + case 'h': + if (gethostname(tmp, sizeof tmp) != 0) + fatal("gethostname failed"); + if ((ptr = strchr(tmp, '.')) != NULL) + *ptr = '\0'; + ptr = tmp; + goto do_replace; case 'I': xsnprintf(tmp, sizeof tmp, "%d", wl->idx); ptr = tmp; -- cgit v1.2.3