[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.91 and 1.92

version 1.91, 2020/04/23 05:48:42 version 1.92, 2020/05/16 15:40:04
Line 341 
Line 341 
     struct cmd_find_state *current, const char *fmt, ...)      struct cmd_find_state *current, const char *fmt, ...)
 {  {
         struct cmdq_state               *state = item->state;          struct cmdq_state               *state = item->state;
           struct cmd                      *cmd = item->cmd;
           struct args                     *args = cmd_get_args(cmd);
           struct args_entry               *entryp;
           struct args_value               *valuep;
         struct options                  *oo;          struct options                  *oo;
         va_list                          ap;          va_list                          ap;
         char                            *name;          char                            *name, tmp[32], flag, *arguments;
           int                              i;
           const char                      *value;
         struct cmdq_item                *new_item;          struct cmdq_item                *new_item;
         struct cmdq_state               *new_state;          struct cmdq_state               *new_state;
         struct options_entry            *o;          struct options_entry            *o;
Line 374 
Line 380 
          */           */
         new_state = cmdq_new_state(current, &state->event, CMDQ_STATE_NOHOOKS);          new_state = cmdq_new_state(current, &state->event, CMDQ_STATE_NOHOOKS);
         cmdq_add_format(new_state, "hook", "%s", name);          cmdq_add_format(new_state, "hook", "%s", name);
   
           arguments = args_print(args);
           cmdq_add_format(new_state, "hook_arguments", "%s", arguments);
           free(arguments);
   
           for (i = 0; i < args->argc; i++) {
                   xsnprintf(tmp, sizeof tmp, "hook_argument_%d", i);
                   cmdq_add_format(new_state, tmp, "%s", args->argv[i]);
           }
           flag = args_first(args, &entryp);
           while (flag != 0) {
                   value = args_get(args, flag);
                   if (value == NULL) {
                           xsnprintf(tmp, sizeof tmp, "hook_flag_%c", flag);
                           cmdq_add_format(new_state, tmp, "1");
                   } else {
                           xsnprintf(tmp, sizeof tmp, "hook_flag_%c", flag);
                           cmdq_add_format(new_state, tmp, "%s", value);
                   }
   
                   i = 0;
                   value = args_first_value(args, flag, &valuep);
                   while (value != NULL) {
                           xsnprintf(tmp, sizeof tmp, "hook_flag_%c_%d", flag, i);
                           cmdq_add_format(new_state, tmp, "%s", value);
                           i++;
                           value = args_next_value(&valuep);
                   }
   
                   flag = args_next(&entryp);
           }
   
         a = options_array_first(o);          a = options_array_first(o);
         while (a != NULL) {          while (a != NULL) {

Legend:
Removed from v.1.91  
changed lines
  Added in v.1.92