[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.9 and 1.10

version 1.9, 2014/01/09 13:58:06 version 1.10, 2014/01/28 23:07:09
Line 109 
Line 109 
                 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);
                   memcpy(&o->style, &grid_default_cell, sizeof o->style);
         } else if (o->type == OPTIONS_STRING)          } else if (o->type == OPTIONS_STRING)
                 free(o->str);                  free(o->str);
   
Line 140 
Line 141 
                 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);
                   memcpy(&o->style, &grid_default_cell, sizeof o->style);
         } else if (o->type == OPTIONS_STRING)          } else if (o->type == OPTIONS_STRING)
                 free(o->str);                  free(o->str);
   
Line 158 
Line 160 
         if (o->type != OPTIONS_NUMBER)          if (o->type != OPTIONS_NUMBER)
                 fatalx("option not a number");                  fatalx("option not a number");
         return (o->num);          return (o->num);
   }
   
   struct options_entry *
   options_set_style(struct options *oo, const char *name, const char *value,
       int append)
   {
           struct options_entry    *o;
   
           if ((o = options_find1(oo, name)) == NULL) {
                   o = xmalloc(sizeof *o);
                   o->name = xstrdup(name);
                   RB_INSERT(options_tree, &oo->tree, o);
           } else if (o->type == OPTIONS_STRING)
                   free(o->str);
   
           if (!append)
                   memcpy(&o->style, &grid_default_cell, sizeof o->style);
   
           o->type = OPTIONS_STYLE;
           if (style_parse(&grid_default_cell, &o->style, value) == -1)
                   return (NULL);
           return (o);
   }
   
   struct grid_cell *
   options_get_style(struct options *oo, const char *name)
   {
           struct options_entry    *o;
   
           if ((o = options_find(oo, name)) == NULL)
                   fatalx("missing option");
           if (o->type != OPTIONS_STYLE)
                   fatalx("option not a style");
           return (&o->style);
 }  }

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10