mirror of
https://github.com/tmux/tmux.git
synced 2025-01-07 08:18:48 +00:00
Add a patch missed during a merge sometime to use
TAILQ_FOREACH_SAFE. From Tiago Cunha.
This commit is contained in:
parent
20129b7bf9
commit
6804d5841e
@ -43,7 +43,7 @@ cmd_kill_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
|
|||||||
{
|
{
|
||||||
struct args *args = self->args;
|
struct args *args = self->args;
|
||||||
struct winlink *wl;
|
struct winlink *wl;
|
||||||
struct window_pane *loopwp, *nextwp, *wp;
|
struct window_pane *loopwp, *tmpwp, *wp;
|
||||||
|
|
||||||
if ((wl = cmd_find_pane(ctx, args_get(args, 't'), NULL, &wp)) == NULL)
|
if ((wl = cmd_find_pane(ctx, args_get(args, 't'), NULL, &wp)) == NULL)
|
||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
@ -56,15 +56,12 @@ cmd_kill_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (args_has(self->args, 'a')) {
|
if (args_has(self->args, 'a')) {
|
||||||
loopwp = TAILQ_FIRST(&wl->window->panes);
|
TAILQ_FOREACH_SAFE(loopwp, &wl->window->panes, entry, tmpwp) {
|
||||||
while (loopwp != NULL) {
|
if (loopwp == wp)
|
||||||
nextwp = TAILQ_NEXT(loopwp, entry);
|
continue;
|
||||||
if (loopwp != wp) {
|
|
||||||
layout_close_pane(loopwp);
|
layout_close_pane(loopwp);
|
||||||
window_remove_pane(wl->window, loopwp);
|
window_remove_pane(wl->window, loopwp);
|
||||||
}
|
}
|
||||||
loopwp = nextwp;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
layout_close_pane(wp);
|
layout_close_pane(wp);
|
||||||
window_remove_pane(wl->window, wp);
|
window_remove_pane(wl->window, wp);
|
||||||
|
Loading…
Reference in New Issue
Block a user