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

Diff for /src/usr.bin/tmux/cmd-find.c between version 1.15 and 1.16

version 1.15, 2015/10/23 16:29:07 version 1.16, 2015/10/27 13:23:24
Line 129 
Line 129 
                 return (NULL);                  return (NULL);
         if (pid != getpid())          if (pid != getpid())
                 return (NULL);                  return (NULL);
         log_debug("client %d TMUX is %s (session @%u)", c->ibuf.fd,          log_debug("client %p TMUX is %s (session @%u)", c, envent->value,
             envent->value, session);              session);
   
         s = session_find_by_id(session);          s = session_find_by_id(session);
         if (s == NULL || (w != NULL && !session_has(s, w)))          if (s == NULL || (w != NULL && !session_has(s, w)))
Line 333 
Line 333 
 {  {
         /* If we know the current client, use it. */          /* If we know the current client, use it. */
         if (fs->cmdq->client != NULL) {          if (fs->cmdq->client != NULL) {
                   log_debug("%s: have client %p%s", __func__, fs->cmdq->client,
                       fs->cmdq->client->session == NULL ? "" : " (with session)");
                 if (fs->cmdq->client->session == NULL)                  if (fs->cmdq->client->session == NULL)
                         return (cmd_find_current_session_with_client(fs));                          return (cmd_find_current_session_with_client(fs));
                 fs->s = fs->cmdq->client->session;                  fs->s = fs->cmdq->client->session;
Line 365 
Line 367 
         u_int                    csize;          u_int                    csize;
   
         /* If the queue client has a session, use it. */          /* If the queue client has a session, use it. */
         if (cmdq->client != NULL && cmdq->client->session != NULL)          if (cmdq->client != NULL && cmdq->client->session != NULL) {
                   log_debug("%s: using cmdq %p client %p", __func__, cmdq,
                       cmdq->client);
                 return (cmdq->client);                  return (cmdq->client);
           }
   
         /* Otherwise find the current session. */          /* Otherwise find the current session. */
         cmd_find_clear_state(&current, cmdq, 0);          cmd_find_clear_state(&current, cmdq, 0);
Line 375 
Line 380 
   
         /* If it is attached, find the best of it's clients. */          /* If it is attached, find the best of it's clients. */
         s = current.s;          s = current.s;
           log_debug("%s: current session $%u %s", __func__, s->id, s->name);
         if (~s->flags & SESSION_UNATTACHED) {          if (~s->flags & SESSION_UNATTACHED) {
                 csize = 0;                  csize = 0;
                 TAILQ_FOREACH(c, &clients, entry) {                  TAILQ_FOREACH(c, &clients, entry) {
Line 1220 
Line 1226 
                 c = cmd_find_current_client(cmdq);                  c = cmd_find_current_client(cmdq);
                 if (c == NULL && !quiet)                  if (c == NULL && !quiet)
                         cmdq_error(cmdq, "no current client");                          cmdq_error(cmdq, "no current client");
                   log_debug("%s: no target, return %p", __func__, c);
                 return (c);                  return (c);
         }          }
         copy = xstrdup(target);          copy = xstrdup(target);
Line 1251 
Line 1258 
                 cmdq_error(cmdq, "can't find client %s", copy);                  cmdq_error(cmdq, "can't find client %s", copy);
   
         free(copy);          free(copy);
           log_debug("%s: target %s, return %p", __func__, target, c);
         return (c);          return (c);
 }  }
   

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16