diff options
author | 2015-04-27 22:58:58 +0000 | |
---|---|---|
committer | 2015-04-27 22:58:58 +0000 | |
commit | 3826ac9f93622fffb39a910387510f28be050aff (patch) | |
tree | aeb635a41c935f0a9ac2dadf2055d550baf09597 /usr.bin/tmux/cmd-find.c | |
parent | Reset cfg_ncauses to 0 as well or we could allocate the wrong size if (diff) | |
download | wireguard-openbsd-3826ac9f93622fffb39a910387510f28be050aff.tar.xz wireguard-openbsd-3826ac9f93622fffb39a910387510f28be050aff.zip |
Do not include unattached clients when trying to find one for target.
Diffstat (limited to 'usr.bin/tmux/cmd-find.c')
-rw-r--r-- | usr.bin/tmux/cmd-find.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/tmux/cmd-find.c b/usr.bin/tmux/cmd-find.c index 2f839488090..4ff0f3fb114 100644 --- a/usr.bin/tmux/cmd-find.c +++ b/usr.bin/tmux/cmd-find.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-find.c,v 1.2 2015/04/27 22:42:10 nicm Exp $ */ +/* $OpenBSD: cmd-find.c,v 1.3 2015/04/27 22:58:58 nicm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@users.sourceforge.net> @@ -125,11 +125,15 @@ cmd_find_best_client(struct client **clist, u_int csize) c = NULL; if (clist != NULL) { for (i = 0; i < csize; i++) { + if (clist[i]->session == NULL) + continue; if (cmd_find_client_better(clist[i], c)) c = clist[i]; } } else { TAILQ_FOREACH(c_loop, &clients, entry) { + if (c_loop->session == NULL) + continue; if (cmd_find_client_better(c_loop, c)) c = c_loop; } |