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

Diff for /src/usr.bin/tmux/options.c between version 1.44 and 1.45

version 1.44, 2019/05/12 18:16:33 version 1.45, 2019/05/23 11:13:30
Line 353 
Line 353 
 {  {
         struct options_array_item       *a;          struct options_array_item       *a;
         char                            *new;          char                            *new;
         struct cmd_list                 *cmdlist;          struct cmd_parse_result         *pr;
         char                            *error;  
   
         if (!OPTIONS_IS_ARRAY(o)) {          if (!OPTIONS_IS_ARRAY(o)) {
                 if (cause != NULL)                  if (cause != NULL)
Line 363 
Line 362 
         }          }
   
         if (OPTIONS_IS_COMMAND(o)) {          if (OPTIONS_IS_COMMAND(o)) {
                 cmdlist = cmd_string_parse(value, NULL, 0, &error);                  pr = cmd_parse_from_string(value, NULL);
                 if (cmdlist == NULL && error != NULL) {                  switch (pr->status) {
                   case CMD_PARSE_EMPTY:
                           *cause = xstrdup("empty command");
                           return (-1);
                   case CMD_PARSE_ERROR:
                         if (cause != NULL)                          if (cause != NULL)
                                 *cause = error;                                  *cause = pr->error;
                         else                          else
                                 free(error);                                  free(pr->error);
                         return (-1);                          return (-1);
                   case CMD_PARSE_SUCCESS:
                           break;
                 }                  }
         }          }
   
Line 397 
Line 402 
         if (OPTIONS_IS_STRING(o))          if (OPTIONS_IS_STRING(o))
                 a->value.string = new;                  a->value.string = new;
         else if (OPTIONS_IS_COMMAND(o))          else if (OPTIONS_IS_COMMAND(o))
                 a->value.cmdlist = cmdlist;                  a->value.cmdlist = pr->cmdlist;
         return (0);          return (0);
 }  }
   

Legend:
Removed from v.1.44  
changed lines
  Added in v.1.45