[BACK]Return to cmd-detach-client.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/cmd-detach-client.c between version 1.18 and 1.19

version 1.18, 2014/10/20 23:01:51 version 1.19, 2015/01/30 15:57:30
Line 48 
Line 48 
 cmd_detach_client_exec(struct cmd *self, struct cmd_q *cmdq)  cmd_detach_client_exec(struct cmd *self, struct cmd_q *cmdq)
 {  {
         struct args     *args = self->args;          struct args     *args = self->args;
         struct client   *c, *c2;          struct client   *c, *cloop;
         struct session  *s;          struct session  *s;
         enum msgtype     msgtype;          enum msgtype     msgtype;
         u_int            i;          u_int            i;
Line 73 
Line 73 
                         return (CMD_RETURN_ERROR);                          return (CMD_RETURN_ERROR);
   
                 for (i = 0; i < ARRAY_LENGTH(&clients); i++) {                  for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
                         c = ARRAY_ITEM(&clients, i);                          cloop = ARRAY_ITEM(&clients, i);
                         if (c == NULL || c->session != s)                          if (cloop == NULL || cloop->session != s)
                                 continue;                                  continue;
                         server_write_client(c, msgtype, c->session->name,                          server_write_client(cloop, msgtype,
                             strlen(c->session->name) + 1);                              cloop->session->name,
                               strlen(cloop->session->name) + 1);
                 }                  }
         } else {                  return (CMD_RETURN_STOP);
                 c = cmd_find_client(cmdq, args_get(args, 't'), 0);          }
                 if (c == NULL)  
                         return (CMD_RETURN_ERROR);  
   
                 if (args_has(args, 'a')) {          c = cmd_find_client(cmdq, args_get(args, 't'), 0);
                         for (i = 0; i < ARRAY_LENGTH(&clients); i++) {          if (c == NULL)
                                 c2 = ARRAY_ITEM(&clients, i);                  return (CMD_RETURN_ERROR);
                                 if (c2 == NULL || c2->session == NULL ||  
                                     c2 == c)          if (args_has(args, 'a')) {
                                         continue;                  for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
                                 server_write_client(c2, msgtype,                          cloop = ARRAY_ITEM(&clients, i);
                                     c2->session->name,                          if (cloop == NULL || cloop->session == NULL)
                                     strlen(c2->session->name) + 1);                                  continue;
                         }                          if (cloop == c)
                 } else {                                  continue;
                         server_write_client(c, msgtype, c->session->name,                          server_write_client(cloop, msgtype,
                             strlen(c->session->name) + 1);                              cloop->session->name,
                               strlen(cloop->session->name) + 1);
                 }                  }
                   return (CMD_RETURN_NORMAL);
         }          }
   
           server_write_client(c, msgtype, c->session->name,
               strlen(c->session->name) + 1);
         return (CMD_RETURN_STOP);          return (CMD_RETURN_STOP);
 }  }

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19