summaryrefslogtreecommitdiffstats
path: root/server-fn.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2010-01-23 21:07:31 +0000
committerNicholas Marriott <nicm@openbsd.org>2010-01-23 21:07:31 +0000
commitb9ade6e6bb54538dd1164e3a16d261b6580ba4a9 (patch)
tree3b8de7e513d176e8b8540ba9669d0af4bf9bee9e /server-fn.c
parentc0d3e4315c4465d2c665ab2a9151ac31e72f6882 (diff)
When a window is destroyed, remove all links to it from each session rather
than just the first. Reported by Robin Lee Powell.
Diffstat (limited to 'server-fn.c')
-rw-r--r--server-fn.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/server-fn.c b/server-fn.c
index ce5e518d..3c7277bd 100644
--- a/server-fn.c
+++ b/server-fn.c
@@ -260,13 +260,13 @@ server_kill_window(struct window *w)
s = ARRAY_ITEM(&sessions, i);
if (s == NULL || !session_has(s, w))
continue;
- if ((wl = winlink_find_by_window(&s->windows, w)) == NULL)
- continue;
-
- if (session_detach(s, wl))
- server_destroy_session_group(s);
- else
- server_redraw_session_group(s);
+ while ((wl = winlink_find_by_window(&s->windows, w)) != NULL) {
+ if (session_detach(s, wl)) {
+ server_destroy_session_group(s);
+ break;
+ } else
+ server_redraw_session_group(s);
+ }
}
}