Revision: 2847
          http://tmux.svn.sourceforge.net/tmux/?rev=2847&view=rev
Author:   tcunha
Date:     2012-07-12 21:04:43 +0000 (Thu, 12 Jul 2012)
Log Message:
-----------
Now that the queue _SAFE macros are available, use them instead of rolling
our own. This is analogous to the recent changes to the detach-client and
kill-{session,window} commands.

Modified Paths:
--------------
    trunk/cmd-kill-pane.c

Modified: trunk/cmd-kill-pane.c
===================================================================
--- trunk/cmd-kill-pane.c       2012-07-12 20:59:39 UTC (rev 2846)
+++ trunk/cmd-kill-pane.c       2012-07-12 21:04:43 UTC (rev 2847)
@@ -43,7 +43,7 @@
 {
        struct args             *args = self->args;
        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)
                return (CMD_RETURN_ERROR);
@@ -56,14 +56,11 @@
        }
 
        if (args_has(self->args, 'a')) {
-               loopwp = TAILQ_FIRST(&wl->window->panes);
-               while (loopwp != NULL) {
-                       nextwp = TAILQ_NEXT(loopwp, entry);
-                       if (loopwp != wp) {
-                               layout_close_pane(loopwp);
-                               window_remove_pane(wl->window, loopwp);
-                       }
-                       loopwp = nextwp;
+               TAILQ_FOREACH_SAFE(loopwp, &wl->window->panes, entry, tmpwp) {
+                       if (loopwp == wp)
+                               continue;
+                       layout_close_pane(loopwp);
+                       window_remove_pane(wl->window, loopwp);
                }
        } else {
                layout_close_pane(wp);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to