diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2011-04-24 21:32:07 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2011-04-24 21:32:07 +0000 |
commit | eb288aae3223576ebe3f68f5faaa1c4fd02cb73b (patch) | |
tree | 44150e3eecb037e1fa5e6c248b4616f67c8d341a /status.c | |
parent | dc8fb9fb23f22ef4f2aedaee55d6e008b0089be3 (diff) | |
download | rtmux-eb288aae3223576ebe3f68f5faaa1c4fd02cb73b.tar.gz rtmux-eb288aae3223576ebe3f68f5faaa1c4fd02cb73b.tar.bz2 rtmux-eb288aae3223576ebe3f68f5faaa1c4fd02cb73b.zip |
Provide #h for short hostname (no domain) from Michal Mazurek.
Diffstat (limited to 'status.c')
-rw-r--r-- | status.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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; |