[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.304 and 1.305

version 1.304, 2022/05/30 13:07:06 version 1.305, 2022/06/21 09:30:01
Line 3387 
Line 3387 
 }  }
   
 /* Make a prettier time. */  /* Make a prettier time. */
 static char *  char *
 format_pretty_time(time_t t)  format_pretty_time(time_t t, int seconds)
 {  {
         struct tm       now_tm, tm;          struct tm       now_tm, tm;
         time_t          now, age;          time_t          now, age;
         char            s[6];          char            s[9];
   
         time(&now);          time(&now);
         if (now < t)          if (now < t)
Line 3404 
Line 3404 
   
         /* Last 24 hours. */          /* Last 24 hours. */
         if (age < 24 * 3600) {          if (age < 24 * 3600) {
                 strftime(s, sizeof s, "%H:%M", &tm);                  if (seconds)
                           strftime(s, sizeof s, "%H:%M:%S", &tm);
                   else
                           strftime(s, sizeof s, "%H:%M", &tm);
                 return (xstrdup(s));                  return (xstrdup(s));
         }          }
   
Line 3509 
Line 3512 
                 if (t == 0)                  if (t == 0)
                         return (NULL);                          return (NULL);
                 if (modifiers & FORMAT_PRETTY)                  if (modifiers & FORMAT_PRETTY)
                         found = format_pretty_time(t);                          found = format_pretty_time(t, 0);
                 else {                  else {
                         if (time_format != NULL) {                          if (time_format != NULL) {
                                 localtime_r(&t, &tm);                                  localtime_r(&t, &tm);

Legend:
Removed from v.1.304  
changed lines
  Added in v.1.305