diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2013-10-15 00:15:12 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2013-10-15 00:15:12 +0000 |
commit | 404151a9d4628a4c3138509f976e2766d48fe320 (patch) | |
tree | 95cd00c7dc993ac15d61e70cdfc70685646462e1 /usr.bin | |
parent | ef4c8c8611613d29eb4abd522dbfe1176f15779c (diff) |
Fix detach -a by skipping clients where the session is NULL.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/cmd-detach-client.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-detach-client.c b/usr.bin/tmux/cmd-detach-client.c index 5c4c9608473..110582a46b3 100644 --- a/usr.bin/tmux/cmd-detach-client.c +++ b/usr.bin/tmux/cmd-detach-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-detach-client.c,v 1.15 2013/10/10 12:28:08 nicm Exp $ */ +/* $OpenBSD: cmd-detach-client.c,v 1.16 2013/10/15 00:15:11 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -71,7 +71,8 @@ cmd_detach_client_exec(struct cmd *self, struct cmd_q *cmdq) if (args_has(args, 'a')) { for (i = 0; i < ARRAY_LENGTH(&clients); i++) { c2 = ARRAY_ITEM(&clients, i); - if (c2 == NULL || c == c2) + if (c2 == NULL || c2->session == NULL || + c2 == c) continue; server_write_client(c2, msgtype, c2->session->name, |