diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-01-23 21:07:32 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-01-23 21:07:32 +0000 |
commit | af492e3402d7ff1f92390230f1483ed91ce50409 (patch) | |
tree | ff20b70936846445b730f1e4190506a8263a22b0 | |
parent | b5f76205ad925bb34aadd4f06e0957373b65e6c8 (diff) |
When a window is destroyed, remove all links to it from each session rather
than just the first. Reported by Robin Lee Powell.
-rw-r--r-- | usr.bin/tmux/server-fn.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/tmux/server-fn.c b/usr.bin/tmux/server-fn.c index 47787fad308..a7018a13822 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.33 2010/01/03 12:51:05 nicm Exp $ */ +/* $OpenBSD: server-fn.c,v 1.34 2010/01/23 21:07:31 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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); + } } } |