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

Diff for /src/usr.bin/calendar/day.c between version 1.30 and 1.31

version 1.30, 2015/10/23 11:43:16 version 1.31, 2015/12/07 18:46:35
Line 78 
Line 78 
 static struct fixs nmonths[13];       /* short national month names */  static struct fixs nmonths[13];       /* short national month names */
   
 void  void
   fill_print_date(struct match *m, struct tm *tm)
   {
           if (strftime(m->print_date, sizeof(m->print_date),
               daynames ? "%a %b %d" : "%b %d", tm) == 0)
                   m->print_date[sizeof(m->print_date) - 1] = '\0';
   }
   
   void
 setnnames(void)  setnnames(void)
 {  {
         char buf[80];          char buf[80];
Line 455 
Line 463 
                         }                          }
   
                         (void)mktime(&tmtmp);                          (void)mktime(&tmtmp);
                         if (strftime(tmp->print_date,                          fill_print_date(tmp, &tmtmp);
                             sizeof(tmp->print_date),  
                         /*    "%a %b %d", &tm);  Skip weekdays */  
                             "%b %d", &tmtmp) == 0)  
                                 tmp->print_date[sizeof(tmp->print_date) - 1] = '\0';  
   
                         tmp->var   = varp;                          tmp->var   = varp;
                         tmp->next  = NULL;                          tmp->next  = NULL;
                         return(tmp);                          return(tmp);
Line 549 
Line 552 
                                         if ((tmp = malloc(sizeof(struct match))) == NULL)                                          if ((tmp = malloc(sizeof(struct match))) == NULL)
                                                 err(1, NULL);                                                  err(1, NULL);
                                         tmp->when = ttmp;                                          tmp->when = ttmp;
                                         if (strftime(tmp->print_date,                                          fill_print_date(tmp, &tmtmp);
                                             sizeof(tmp->print_date),  
                                         /*    "%a %b %d", &tm);  Skip weekdays */  
                                             "%b %d", &tmtmp) == 0)  
                                                 tmp->print_date[sizeof(tmp->print_date) - 1] = '\0';  
                                         tmp->bodun = bodun && tdiff == -1;                                          tmp->bodun = bodun && tdiff == -1;
                                         tmp->var   = varp;                                          tmp->var   = varp;
                                         tmp->next  = NULL;                                          tmp->next  = NULL;

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31