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

Diff for /src/usr.bin/tmux/cmd-attach-session.c between version 1.23 and 1.24

version 1.23, 2013/03/24 09:54:10 version 1.24, 2013/03/24 09:58:40
Line 39 
Line 39 
 };  };
   
 enum cmd_retval  enum cmd_retval
 cmd_attach_session_exec(struct cmd *self, struct cmd_q *cmdq)  cmd_attach_session(struct cmd_q *cmdq, const char* tflag, int dflag, int rflag)
 {  {
         struct args     *args = self->args;  
         struct session  *s;          struct session  *s;
         struct client   *c;          struct client   *c;
         const char      *update;          const char      *update;
Line 53 
Line 52 
                 return (CMD_RETURN_ERROR);                  return (CMD_RETURN_ERROR);
         }          }
   
         if ((s = cmd_find_session(cmdq, args_get(args, 't'), 1)) == NULL)          if ((s = cmd_find_session(cmdq, tflag, 1)) == NULL)
                 return (CMD_RETURN_ERROR);                  return (CMD_RETURN_ERROR);
   
         if (cmdq->client == NULL)          if (cmdq->client == NULL)
                 return (CMD_RETURN_NORMAL);                  return (CMD_RETURN_NORMAL);
   
         if (cmdq->client->session != NULL) {          if (cmdq->client->session != NULL) {
                 if (args_has(self->args, 'd')) {                  if (dflag) {
                         /*                          /*
                          * Can't use server_write_session in case attaching to                           * Can't use server_write_session in case attaching to
                          * the same session as currently attached to.                           * the same session as currently attached to.
Line 87 
Line 86 
                         return (CMD_RETURN_ERROR);                          return (CMD_RETURN_ERROR);
                 }                  }
   
                 if (args_has(self->args, 'r'))                  if (rflag)
                         cmdq->client->flags |= CLIENT_READONLY;                          cmdq->client->flags |= CLIENT_READONLY;
   
                 if (args_has(self->args, 'd'))                  if (dflag)
                         server_write_session(s, MSG_DETACH, NULL, 0);                          server_write_session(s, MSG_DETACH, NULL, 0);
   
                 update = options_get_string(&s->options, "update-environment");                  update = options_get_string(&s->options, "update-environment");
Line 109 
Line 108 
         server_update_socket();          server_update_socket();
   
         return (CMD_RETURN_NORMAL);          return (CMD_RETURN_NORMAL);
   }
   
   enum cmd_retval
   cmd_attach_session_exec(struct cmd *self, struct cmd_q *cmdq)
   {
           struct args     *args = self->args;
   
           return (cmd_attach_session(cmdq, args_get(args, 't'),
               args_has(args, 'd'), args_has(args, 'r')));
 }  }

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24