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

Diff for /src/usr.bin/tmux/format.c between version 1.27 and 1.28

version 1.27, 2013/10/10 11:47:11 version 1.28, 2013/10/10 11:47:28
Line 151 
Line 151 
 format_add(struct format_tree *ft, const char *key, const char *fmt, ...)  format_add(struct format_tree *ft, const char *key, const char *fmt, ...)
 {  {
         struct format_entry     *fe;          struct format_entry     *fe;
           struct format_entry     *fe_now;
         va_list                  ap;          va_list                  ap;
   
         fe = xmalloc(sizeof *fe);          fe = xmalloc(sizeof *fe);
Line 160 
Line 161 
         xvasprintf(&fe->value, fmt, ap);          xvasprintf(&fe->value, fmt, ap);
         va_end(ap);          va_end(ap);
   
         RB_INSERT(format_tree, ft, fe);          fe_now = RB_INSERT(format_tree, ft, fe);
           if (fe_now != NULL) {
                   free(fe_now->value);
                   fe_now->value = fe->value;
                   free(fe->key);
                   free(fe);
           }
 }  }
   
 /* Find a format entry. */  /* Find a format entry. */

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28