[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.107 and 1.108

version 1.107, 2017/01/16 14:49:14 version 1.108, 2017/01/24 19:11:46
Line 160 
Line 160 
                         cmdq_error(item, "not an array: %s", args->argv[0]);                          cmdq_error(item, "not an array: %s", args->argv[0]);
                         return (CMD_RETURN_ERROR);                          return (CMD_RETURN_ERROR);
                 }                  }
         } else {          } else if (*name != '@' && options_array_size(parent, NULL) != -1) {
                 if (*name != '@' && options_array_size(parent, NULL) != -1) {                  if (value == NULL) {
                         cmdq_error(item, "is an array: %s", args->argv[0]);                          cmdq_error(item, "empty value");
                         return (CMD_RETURN_ERROR);                          return (-1);
                 }                  }
                   if (o == NULL)
                           o = options_empty(oo, options_table_entry(parent));
                   if (!args_has(args, 'a'))
                           options_array_clear(o);
                   options_array_assign(o, value);
                   return (CMD_RETURN_NORMAL);
         }          }
   
         /* With -o, check this option is not already set. */          /* With -o, check this option is not already set. */
Line 197 
Line 203 
                         else                          else
                                 options_remove(o);                                  options_remove(o);
                 } else                  } else
                         options_array_set(o, idx, NULL);                          options_array_set(o, idx, NULL, 0);
         } else if (*name == '@')          } else if (*name == '@')
                 options_set_string(oo, name, args_has(args, 'a'), "%s", value);                  options_set_string(oo, name, args_has(args, 'a'), "%s", value);
         else if (idx == -1) {          else if (idx == -1) {
Line 207 
Line 213 
         } else {          } else {
                 if (o == NULL)                  if (o == NULL)
                         o = options_empty(oo, options_table_entry(parent));                          o = options_empty(oo, options_table_entry(parent));
                 if (options_array_set(o, idx, value) != 0) {                  if (options_array_set(o, idx, value, 1) != 0) {
                         cmdq_error(item, "invalid index: %s", args->argv[0]);                          cmdq_error(item, "invalid index: %s", args->argv[0]);
                         return (CMD_RETURN_ERROR);                          return (CMD_RETURN_ERROR);
                 }                  }

Legend:
Removed from v.1.107  
changed lines
  Added in v.1.108