aboutsummaryrefslogtreecommitdiff
path: root/status.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2011-04-25 20:35:22 +0000
committerTiago Cunha <tcunha@gmx.com>2011-04-25 20:35:22 +0000
commit341f67e8276d520c504ca995c89e089e9b1aca02 (patch)
tree7cfd6e7503a8f2c4d94f57129e428b1aa5e9dac3 /status.c
parent38611d3207c03277c39dfd9ebd47a45d96f303f7 (diff)
downloadrtmux-341f67e8276d520c504ca995c89e089e9b1aca02.tar.gz
rtmux-341f67e8276d520c504ca995c89e089e9b1aca02.tar.bz2
rtmux-341f67e8276d520c504ca995c89e089e9b1aca02.zip
Sync OpenBSD patchset 898:
Provide #h for short hostname (no domain) from Michal Mazurek.
Diffstat (limited to 'status.c')
-rw-r--r--status.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/status.c b/status.c
index a8beed3b..307aef1e 100644
--- a/status.c
+++ b/status.c
@@ -1,4 +1,4 @@
-/* $Id: status.c,v 1.158 2011-04-18 21:07:58 nicm Exp $ */
+/* $Id: status.c,v 1.159 2011-04-25 20:35:22 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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;