[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.119 and 1.120

version 1.119, 2017/12/22 10:18:51 version 1.120, 2018/10/18 08:38:01
Line 18 
Line 18 
   
 #include <sys/types.h>  #include <sys/types.h>
   
   #include <fnmatch.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
   
Line 260 
Line 261 
         }          }
         if (strcmp(name, "pane-border-status") == 0) {          if (strcmp(name, "pane-border-status") == 0) {
                 RB_FOREACH(w, windows, &windows)                  RB_FOREACH(w, windows, &windows)
                         layout_fix_panes(w, w->sx, w->sy);                          layout_fix_panes(w);
         }          }
         RB_FOREACH(s, sessions, &sessions)          RB_FOREACH(s, sessions, &sessions)
                 status_update_saved(s);                  status_update_saved(s);
Line 297 
Line 298 
         int                                      append = args_has(args, 'a');          int                                      append = args_has(args, 'a');
         struct options_entry                    *o;          struct options_entry                    *o;
         long long                                number;          long long                                number;
         const char                              *errstr;          const char                              *errstr, *new;
           char                                    *old;
         key_code                                 key;          key_code                                 key;
   
         oe = options_table_entry(parent);          oe = options_table_entry(parent);
Line 310 
Line 312 
   
         switch (oe->type) {          switch (oe->type) {
         case OPTIONS_TABLE_STRING:          case OPTIONS_TABLE_STRING:
                   old = xstrdup(options_get_string(oo, oe->name));
                 options_set_string(oo, oe->name, append, "%s", value);                  options_set_string(oo, oe->name, append, "%s", value);
                   new = options_get_string(oo, oe->name);
                   if (oe->pattern != NULL && fnmatch(oe->pattern, new, 0) != 0) {
                           options_set_string(oo, oe->name, 0, "%s", old);
                           free(old);
                           cmdq_error(item, "value is invalid: %s", value);
                           return (-1);
                   }
                   free(old);
                 return (0);                  return (0);
         case OPTIONS_TABLE_NUMBER:          case OPTIONS_TABLE_NUMBER:
                 number = strtonum(value, oe->minimum, oe->maximum, &errstr);                  number = strtonum(value, oe->minimum, oe->maximum, &errstr);

Legend:
Removed from v.1.119  
changed lines
  Added in v.1.120