=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/session.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- src/usr.bin/tmux/session.c 2014/05/13 08:08:32 1.44 +++ src/usr.bin/tmux/session.c 2014/10/22 23:11:41 1.45 @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.44 2014/05/13 08:08:32 nicm Exp $ */ +/* $OpenBSD: session.c,v 1.45 2014/10/22 23:11:41 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -492,6 +492,19 @@ } } +/* Count number of sessions in session group. */ +u_int +session_group_count(struct session_group *sg) +{ + struct session *s; + u_int n; + + n = 0; + TAILQ_FOREACH(s, &sg->sessions, gentry) + n++; + return (n); +} + /* Synchronize a session to its session group. */ void session_group_synchronize_to(struct session *s) @@ -579,8 +592,9 @@ /* Then free the old winlinks list. */ while (!RB_EMPTY(&old_windows)) { wl = RB_ROOT(&old_windows); - if (winlink_find_by_window_id(&s->windows, wl->window->id) == NULL) - notify_window_unlinked(s, wl->window); + wl2 = winlink_find_by_window_id(&s->windows, wl->window->id); + if (wl2 == NULL) + notify_window_unlinked(s, wl->window); winlink_remove(&old_windows, wl); } }