mirror of
https://github.com/tmux/tmux.git
synced 2025-09-06 00:37:06 +00:00
Sync OpenBSD patchset 898:
Provide #h for short hostname (no domain) from Michal Mazurek.
This commit is contained in:
9
status.c
9
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;
|
||||
|
Reference in New Issue
Block a user