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

Diff for /src/usr.bin/tmux/cmd-set-option.c between version 1.138 and 1.139

version 1.138, 2020/12/15 08:31:50 version 1.139, 2021/08/20 19:50:17
Line 77 
Line 77 
         struct window_pane              *loop;          struct window_pane              *loop;
         struct options                  *oo;          struct options                  *oo;
         struct options_entry            *parent, *o, *po;          struct options_entry            *parent, *o, *po;
         char                            *name, *argument, *value = NULL, *cause;          char                            *name, *argument, *expanded = NULL;
           char                            *cause;
           const char                      *value;
         int                              window, idx, already, error, ambiguous;          int                              window, idx, already, error, ambiguous;
         int                              scope;          int                              scope;
   
         window = (cmd_get_entry(self) == &cmd_set_window_option_entry);          window = (cmd_get_entry(self) == &cmd_set_window_option_entry);
   
         /* Expand argument. */          /* Expand argument. */
         argument = format_single_from_target(item, args->argv[0]);          argument = format_single_from_target(item, args_string(args, 0));
   
         /* If set-hook -R, fire the hook straight away. */          /* If set-hook -R, fire the hook straight away. */
         if (cmd_get_entry(self) == &cmd_set_hook_entry && args_has(args, 'R')) {          if (cmd_get_entry(self) == &cmd_set_hook_entry && args_has(args, 'R')) {
Line 104 
Line 106 
                         cmdq_error(item, "invalid option: %s", argument);                          cmdq_error(item, "invalid option: %s", argument);
                 goto fail;                  goto fail;
         }          }
         if (args->argc < 2)          if (args_count(args) < 2)
                 value = NULL;                  value = NULL;
         else if (args_has(args, 'F'))  
                 value = format_single_from_target(item, args->argv[1]);  
         else          else
                 value = xstrdup(args->argv[1]);                  value = args_string(args, 1);
           if (value != NULL && args_has(args, 'F')) {
                   expanded = format_single_from_target(item, value);
                   value = expanded;
           }
   
         /* Get the scope and table for the option .*/          /* Get the scope and table for the option .*/
         scope = options_scope_from_name(args, window, name, target, &oo,          scope = options_scope_from_name(args, window, name, target, &oo,
Line 211 
Line 215 
   
 out:  out:
         free(argument);          free(argument);
         free(value);          free(expanded);
         free(name);          free(name);
         return (CMD_RETURN_NORMAL);          return (CMD_RETURN_NORMAL);
   
 fail:  fail:
         free(argument);          free(argument);
         free(value);          free(expanded);
         free(name);          free(name);
         return (CMD_RETURN_ERROR);          return (CMD_RETURN_ERROR);
 }  }

Legend:
Removed from v.1.138  
changed lines
  Added in v.1.139