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

Diff for /src/usr.bin/tmux/cmd-queue.c between version 1.88 and 1.89

version 1.88, 2020/04/13 15:55:51 version 1.89, 2020/04/13 20:51:57
Line 42 
Line 42 
         struct cmdq_item        *next;          struct cmdq_item        *next;
   
         struct client           *client;          struct client           *client;
           struct client           *target_client;
   
         enum cmdq_type           type;          enum cmdq_type           type;
         u_int                    group;          u_int                    group;
Line 145 
Line 146 
         return (item->client);          return (item->client);
 }  }
   
   /* Get item target client. */
   struct client *
   cmdq_get_target_client(struct cmdq_item *item)
   {
           return (item->target_client);
   }
   
 /* Get item state. */  /* Get item state. */
 struct cmdq_state *  struct cmdq_state *
 cmdq_get_state(struct cmdq_item *item)  cmdq_get_state(struct cmdq_item *item)
Line 483 
Line 491 
 static enum cmd_retval  static enum cmd_retval
 cmdq_fire_command(struct cmdq_item *item)  cmdq_fire_command(struct cmdq_item *item)
 {  {
         struct client           *c = item->client;          const char              *name = cmdq_name(item->client);
         const char              *name = cmdq_name(c);  
         struct cmdq_state       *state = item->state;          struct cmdq_state       *state = item->state;
         struct cmd              *cmd = item->cmd;          struct cmd              *cmd = item->cmd;
           struct args             *args = cmd_get_args(cmd);
         const struct cmd_entry  *entry = cmd_get_entry(cmd);          const struct cmd_entry  *entry = cmd_get_entry(cmd);
           struct client           *tc, *saved = item->client;
         enum cmd_retval          retval;          enum cmd_retval          retval;
         struct cmd_find_state   *fsp, fs;          struct cmd_find_state   *fsp, fs;
         int                      flags;          int                      flags, quiet = 0;
         char                    *tmp;          char                    *tmp;
   
         if (log_get_level() > 1) {          if (log_get_level() > 1) {
Line 504 
Line 513 
   
         if (item->client == NULL)          if (item->client == NULL)
                 item->client = cmd_find_client(item, NULL, 1);                  item->client = cmd_find_client(item, NULL, 1);
   
           if (entry->flags & CMD_CLIENT_CANFAIL)
                   quiet = 1;
           if (entry->flags & CMD_CLIENT_CFLAG) {
                   tc = cmd_find_client(item, args_get(args, 'c'), quiet);
                   if (tc == NULL && !quiet) {
                           retval = CMD_RETURN_ERROR;
                           goto out;
                   }
           } else if (entry->flags & CMD_CLIENT_TFLAG) {
                   tc = cmd_find_client(item, args_get(args, 't'), quiet);
                   if (tc == NULL && !quiet) {
                           retval = CMD_RETURN_ERROR;
                           goto out;
                   }
           } else
                   tc = cmd_find_client(item, NULL, 1);
           item->target_client = tc;
   
         retval = cmdq_find_flag(item, &item->source, &entry->source);          retval = cmdq_find_flag(item, &item->source, &entry->source);
         if (retval == CMD_RETURN_ERROR)          if (retval == CMD_RETURN_ERROR)
                 goto out;                  goto out;
Line 511 
Line 539 
         if (retval == CMD_RETURN_ERROR)          if (retval == CMD_RETURN_ERROR)
                 goto out;                  goto out;
   
   
         retval = entry->exec(cmd, item);          retval = entry->exec(cmd, item);
         if (retval == CMD_RETURN_ERROR)          if (retval == CMD_RETURN_ERROR)
                 goto out;                  goto out;
Line 528 
Line 557 
         }          }
   
 out:  out:
         item->client = c;          item->client = saved;
         if (retval == CMD_RETURN_ERROR)          if (retval == CMD_RETURN_ERROR)
                 cmdq_guard(item, "error", flags);                  cmdq_guard(item, "error", flags);
         else          else

Legend:
Removed from v.1.88  
changed lines
  Added in v.1.89