summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2010-08-11 07:36:23 +0000
committerNicholas Marriott <nicm@openbsd.org>2010-08-11 07:36:23 +0000
commitcc474b4ede4644a417f838efe2cc53c6a73028e4 (patch)
tree040d133c43beb187b1fe9cc8c1c9d71f6b9428be
parent8363e31953a346b3cd4141bf30a8d79d37ca2674 (diff)
Treat trying to link or move to the same window as an error to avoid
removing it accidentally.
-rw-r--r--server-fn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/server-fn.c b/server-fn.c
index 4ecbce9e..03c89cf5 100644
--- a/server-fn.c
+++ b/server-fn.c
@@ -281,7 +281,7 @@ server_link_window(struct session *src, struct winlink *srcwl,
dstwl = winlink_find_by_index(&dst->windows, dstidx);
if (dstwl != NULL) {
if (dstwl->window == srcwl->window)
- return (0);
+ return (-1);
if (killflag) {
/*
* Can't use session_detach as it will destroy session