In fact this is probably safer:

Index: server-fn.c
===================================================================
RCS file: /cvs/src/usr.bin/tmux/server-fn.c,v
retrieving revision 1.33
diff -u -p -r1.33 server-fn.c
--- server-fn.c 3 Jan 2010 12:51:05 -0000       1.33
+++ server-fn.c 23 Jan 2010 19:27:10 -0000
@@ -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);
+               }
        }
 }
 



On Sat, Jan 23, 2010 at 07:25:06PM +0000, Nicholas Marriott wrote:
> Pretty simple, please test:
> 
> Index: server-fn.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/tmux/server-fn.c,v
> retrieving revision 1.33
> diff -u -p -r1.33 server-fn.c
> --- server-fn.c       3 Jan 2010 12:51:05 -0000       1.33
> +++ server-fn.c       23 Jan 2010 19:24:29 -0000
> @@ -260,13 +260,12 @@ 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);
> +                     else
> +                             server_redraw_session_group(s);
> +             }
>       }
>  }
>  
> 
> 
> On Sat, Jan 23, 2010 at 11:13:59AM -0800, Robin Lee Powell wrote:
> > 
> > Playing with link-window to try to understand it, I discovered this
> > in HEAD:
> > 
> > tmux new-session
> > tmux link-window
> > exit
> > 
> > [lost server]
> > 
> > -Robin
> > 
> > -- 
> > They say:  "The first AIs will be built by the military as weapons."
> > And I'm  thinking:  "Does it even occur to you to try for something
> > other  than  the default  outcome?"  See http://shrunklink.com/cdiz
> > http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/
> > 
> > ------------------------------------------------------------------------------
> > Throughout its 18-year history, RSA Conference consistently attracts the
> > world's best and brightest in the field, creating opportunities for 
> > Conference
> > attendees to learn about information security's most important issues 
> > through
> > interactions with peers, luminaries and emerging and established companies.
> > http://p.sf.net/sfu/rsaconf-dev2dev
> > _______________________________________________
> > tmux-users mailing list
> > tmux-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/tmux-users
> 
> ------------------------------------------------------------------------------
> Throughout its 18-year history, RSA Conference consistently attracts the
> world's best and brightest in the field, creating opportunities for Conference
> attendees to learn about information security's most important issues through
> interactions with peers, luminaries and emerging and established companies.
> http://p.sf.net/sfu/rsaconf-dev2dev
> _______________________________________________
> tmux-users mailing list
> tmux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tmux-users

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to