[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.57 and 1.58

version 1.57, 2015/02/05 10:29:43 version 1.58, 2015/02/06 17:11:39
Line 326 
Line 326 
         return (-1);          return (-1);
 }  }
   
   /* Expand keys in a template, passing through strftime first. */
   char *
   format_expand_time(struct format_tree *ft, const char *fmt, time_t t)
   {
           char            *tmp, *expanded;
           size_t           tmplen;
           struct tm       *tm;
   
           if (fmt == NULL)
                   return (xstrdup(""));
   
           tm = localtime(&t);
   
           tmp = NULL;
           tmplen = strlen(fmt);
   
           do {
                   tmp = xreallocarray(tmp, 2, tmplen);
                   tmplen *= 2;
           } while (strftime(tmp, tmplen, fmt, tm) == 0);
   
           expanded = format_expand(ft, tmp);
           free(tmp);
   
           return (expanded);
   }
   
 /* Expand keys in a template. */  /* Expand keys in a template. */
 char *  char *
 format_expand(struct format_tree *ft, const char *fmt)  format_expand(struct format_tree *ft, const char *fmt)
Line 334 
Line 361 
         const char      *ptr, *s;          const char      *ptr, *s;
         size_t           off, len, n;          size_t           off, len, n;
         int              ch, brackets;          int              ch, brackets;
   
           if (fmt == NULL)
                   return (xstrdup(""));
   
         len = 64;          len = 64;
         buf = xmalloc(len);          buf = xmalloc(len);

Legend:
Removed from v.1.57  
changed lines
  Added in v.1.58