From nobody@FreeBSD.org  Mon Jul 11 08:32:30 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DAE99106567B
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 11 Jul 2011 08:32:30 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id B22DE8FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 11 Jul 2011 08:32:30 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p6B8WUOV044998
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 11 Jul 2011 08:32:30 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p6B8WUBo044997;
	Mon, 11 Jul 2011 08:32:30 GMT
	(envelope-from nobody)
Message-Id: <201107110832.p6B8WUBo044997@red.freebsd.org>
Date: Mon, 11 Jul 2011 08:32:30 GMT
From: Pietro Cerutti <gahr@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] sysutils/tmux -- support #h status special char
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         158796
>Category:       ports
>Synopsis:       [patch] sysutils/tmux -- support #h status special char
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    wen
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 11 08:40:10 UTC 2011
>Closed-Date:    Mon Jul 11 11:05:35 UTC 2011
>Last-Modified:  Mon Jul 11 11:05:35 UTC 2011
>Originator:     Pietro Cerutti
>Release:        
>Organization:
The FreeBSD Project
>Environment:
>Description:
The patch attached, taken from OpenBSD CSV [1], adds support for the #h status bar special char, meaning "hostname of local host without the domain name".

[1] http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/tmux/status.c?rev=1.74
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: files/patch-hostname.diff
===================================================================
RCS file: files/patch-hostname.diff
diff -N files/patch-hostname.diff
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-hostname.diff	11 Jul 2011 08:25:35 -0000
@@ -0,0 +1,32 @@
+--- status.c.orig	2011/04/18 20:49:05	1.73
++++ status.c	2011/04/24 22:32:07	1.74
+@@ -1,4 +1,4 @@
+-/* $OpenBSD: status.c,v 1.73 2011/04/18 19:49:05 nicm Exp $ */
++/* $OpenBSD: status.c,v 1.74 2011/04/24 21:32:07 nicm Exp $ */
+ 
+ /*
+  * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
+@@ -408,6 +408,13 @@ status_replace1(struct client *c, struct session *s, s
+ 	case 'H':
+ 		if (gethostname(tmp, sizeof tmp) != 0)
+ 			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':
+--- tmux.1.orig	2011/04/19 22:31:33	1.223
++++ tmux.1	2011/04/24 22:32:07	1.224
+@@ -2005,6 +2005,7 @@ may contain any of the following special character seq
+ .It Li "#(shell-command)" Ta "First line of the command's output"
+ .It Li "#[attributes]" Ta "Colour or attribute change"
+ .It Li "#H" Ta "Hostname of local host"
++.It Li "#h" Ta "Hostname of local host without the domain name"
+ .It Li "#F" Ta "Current window flag"
+ .It Li "#I" Ta "Current window index"
+ .It Li "#P" Ta "Current pane index"


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->wen 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Jul 11 08:40:21 UTC 2011 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=158796 

From: wen heping <wenheping@gmail.com>
To: bug-followup@FreeBSD.org, gahr@FreeBSD.org
Cc:  
Subject: Re: ports/158796: [patch] sysutils/tmux -- support #h status special char
Date: Mon, 11 Jul 2011 17:44:27 +0800

 Hi,
 
    I approve and would you commit it ? I can only commit it until
 August when I come back from my summer vacation.
    Thanks.
 
 wen

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/158796: commit references a PR
Date: Mon, 11 Jul 2011 10:49:20 +0000 (UTC)

 gahr        2011-07-11 10:49:06 UTC
 
   FreeBSD ports repository
 
   Modified files:
     sysutils/tmux        Makefile 
   Added files:
     sysutils/tmux/files  patch-hostname.diff 
   Log:
   - add support for the #h status line special char to print to hostname of the
     localhost without the domain name
   
   PR:             158796
   Submitted by:   gahr@FreeBSD.org
   Approved by:    wen@ (maintainer)
   
   Revision  Changes    Path
   1.30      +1 -1      ports/sysutils/tmux/Makefile
   1.1       +32 -0     ports/sysutils/tmux/files/patch-hostname.diff (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: gahr 
State-Changed-When: Mon Jul 11 11:05:34 UTC 2011 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=158796 
>Unformatted:
