=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-detach-client.c,v retrieving revision 1.19 retrieving revision 1.20 diff -c -r1.19 -r1.20 *** src/usr.bin/tmux/cmd-detach-client.c 2015/01/30 15:57:30 1.19 --- src/usr.bin/tmux/cmd-detach-client.c 2015/04/24 23:17:11 1.20 *************** *** 1,4 **** ! /* $OpenBSD: cmd-detach-client.c,v 1.19 2015/01/30 15:57:30 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-detach-client.c,v 1.20 2015/04/24 23:17:11 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 51,57 **** struct client *c, *cloop; struct session *s; enum msgtype msgtype; - u_int i; if (self->entry == &cmd_suspend_client_entry) { if ((c = cmd_find_client(cmdq, args_get(args, 't'), 0)) == NULL) --- 51,56 ---- *************** *** 72,80 **** if (s == NULL) return (CMD_RETURN_ERROR); ! for (i = 0; i < ARRAY_LENGTH(&clients); i++) { ! cloop = ARRAY_ITEM(&clients, i); ! if (cloop == NULL || cloop->session != s) continue; server_write_client(cloop, msgtype, cloop->session->name, --- 71,78 ---- if (s == NULL) return (CMD_RETURN_ERROR); ! TAILQ_FOREACH(cloop, &clients, entry) { ! if (cloop->session != s) continue; server_write_client(cloop, msgtype, cloop->session->name, *************** *** 88,98 **** return (CMD_RETURN_ERROR); if (args_has(args, 'a')) { ! for (i = 0; i < ARRAY_LENGTH(&clients); i++) { ! cloop = ARRAY_ITEM(&clients, i); ! if (cloop == NULL || cloop->session == NULL) ! continue; ! if (cloop == c) continue; server_write_client(cloop, msgtype, cloop->session->name, --- 86,93 ---- return (CMD_RETURN_ERROR); if (args_has(args, 'a')) { ! TAILQ_FOREACH(cloop, &clients, entry) { ! if (cloop->session == NULL || cloop == c) continue; server_write_client(cloop, msgtype, cloop->session->name,