diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-04-24 23:17:12 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-04-24 23:17:12 +0000 |
commit | 42f208ecc04cf6440525f861a8e584453096e7d8 (patch) | |
tree | b4ac104eea31f3370212810894a607fef5705c76 /usr.bin/tmux/cmd-attach-session.c | |
parent | 3002403126d1fc845a49b01274f3316c6ac928c8 (diff) |
Convert clients list into a TAILQ.
Diffstat (limited to 'usr.bin/tmux/cmd-attach-session.c')
-rw-r--r-- | usr.bin/tmux/cmd-attach-session.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/usr.bin/tmux/cmd-attach-session.c b/usr.bin/tmux/cmd-attach-session.c index 71b7a03a2f8..4d6438efac9 100644 --- a/usr.bin/tmux/cmd-attach-session.c +++ b/usr.bin/tmux/cmd-attach-session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-attach-session.c,v 1.32 2015/02/05 10:29:43 nicm Exp $ */ +/* $OpenBSD: cmd-attach-session.c,v 1.33 2015/04/24 23:17:11 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -51,7 +51,6 @@ cmd_attach_session(struct cmd_q *cmdq, const char *tflag, int dflag, int rflag, struct window_pane *wp = NULL; const char *update; char *cause; - u_int i; int fd; struct format_tree *ft; char *cp; @@ -92,11 +91,8 @@ cmd_attach_session(struct cmd_q *cmdq, const char *tflag, int dflag, int rflag, * Can't use server_write_session in case attaching to * the same session as currently attached to. */ - for (i = 0; i < ARRAY_LENGTH(&clients); i++) { - c = ARRAY_ITEM(&clients, i); - if (c == NULL || c->session != s) - continue; - if (c == cmdq->client) + TAILQ_FOREACH(c, &clients, entry) { + if (c->session != s || c == cmdq->client) continue; server_write_client(c, MSG_DETACH, c->session->name, |