[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.11 and 1.12

version 1.11, 2014/10/20 23:57:14 version 1.12, 2015/02/18 15:32:37
Line 167 
Line 167 
     int append)      int append)
 {  {
         struct options_entry    *o;          struct options_entry    *o;
           struct grid_cell         tmpgc;
   
         if ((o = options_find1(oo, name)) == NULL) {          o = options_find1(oo, name);
           if (o == NULL || !append)
                   memcpy(&tmpgc, &grid_default_cell, sizeof tmpgc);
           else
                   memcpy(&tmpgc, &o->style, sizeof tmpgc);
   
           if (style_parse(&grid_default_cell, &tmpgc, value) == -1)
                   return (NULL);
   
           if (o == NULL) {
                 o = xmalloc(sizeof *o);                  o = xmalloc(sizeof *o);
                 o->name = xstrdup(name);                  o->name = xstrdup(name);
                 RB_INSERT(options_tree, &oo->tree, o);                  RB_INSERT(options_tree, &oo->tree, o);
         } else if (o->type == OPTIONS_STRING)          } else if (o->type == OPTIONS_STRING)
                 free(o->str);                  free(o->str);
   
         if (!append)  
                 memcpy(&o->style, &grid_default_cell, sizeof o->style);  
   
         o->type = OPTIONS_STYLE;          o->type = OPTIONS_STYLE;
         if (style_parse(&grid_default_cell, &o->style, value) == -1)          memcpy(&o->style, &tmpgc, sizeof o->style);
                 return (NULL);  
         return (o);          return (o);
 }  }
   

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12