summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/server-fn.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2010-10-09 12:58:01 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2010-10-09 12:58:01 +0000
commitc5c812377cde50a713d321a47c179143f7bf339a (patch)
treea9ee90ddd0a4ff5ed5ce10b89e0e0785b732bb19 /usr.bin/tmux/server-fn.c
parentec7129786be17458bcdb5069b069b4e5d71530ac (diff)
Set cause when failing due to linking a window to itself, from Martin
Pieuchot.
Diffstat (limited to 'usr.bin/tmux/server-fn.c')
-rw-r--r--usr.bin/tmux/server-fn.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/tmux/server-fn.c b/usr.bin/tmux/server-fn.c
index c7253dc09d3..89597fe5934 100644
--- a/usr.bin/tmux/server-fn.c
+++ b/usr.bin/tmux/server-fn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-fn.c,v 1.43 2010/10/05 17:15:21 nicm Exp $ */
+/* $OpenBSD: server-fn.c,v 1.44 2010/10/09 12:58:00 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -280,8 +280,10 @@ server_link_window(struct session *src, struct winlink *srcwl,
if (dstidx != -1)
dstwl = winlink_find_by_index(&dst->windows, dstidx);
if (dstwl != NULL) {
- if (dstwl->window == srcwl->window)
+ if (dstwl->window == srcwl->window) {
+ xasprintf(cause, "same index: %d", dstidx);
return (-1);
+ }
if (killflag) {
/*
* Can't use session_detach as it will destroy session