summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2012-05-29 08:12:14 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2012-05-29 08:12:14 +0000
commit2a63167e5f635c98e832e8048c2a72191208af8b (patch)
treec7900fcd38593f6b7a7a320eb16a596cd8e9e002 /usr.bin/tmux
parent626bd9662ee2e620e099fea7090a53a8577a0a06 (diff)
Use RB_FOREACH_SAFE as winlinks are being removed, from Chris Johnsen.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/cmd-kill-window.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-kill-window.c b/usr.bin/tmux/cmd-kill-window.c
index f96663554ce..912146409ce 100644
--- a/usr.bin/tmux/cmd-kill-window.c
+++ b/usr.bin/tmux/cmd-kill-window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-kill-window.c,v 1.10 2012/05/29 08:11:34 nicm Exp $ */
+/* $OpenBSD: cmd-kill-window.c,v 1.11 2012/05/29 08:12:13 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -40,14 +40,14 @@ int
cmd_kill_window_exec(struct cmd *self, struct cmd_ctx *ctx)
{
struct args *args = self->args;
- struct winlink *wl, *wl2;
+ struct winlink *wl, *wl2, *wl3;
struct session *s;
if ((wl = cmd_find_window(ctx, args_get(args, 't'), &s)) == NULL)
return (-1);
if (args_has(args, 'a')) {
- RB_FOREACH(wl2, winlinks, &s->windows) {
+ RB_FOREACH_SAFE(wl2, winlinks, &s->windows, wl3) {
if (wl != wl2)
server_kill_window(wl2->window);
}