[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.12 and 1.14

version 1.12, 2001/09/26 20:38:55 version 1.14, 2001/11/19 19:02:13
Line 433 
Line 433 
                         }                          }
                         if ((tmp = malloc(sizeof(struct match))) == NULL)                          if ((tmp = malloc(sizeof(struct match))) == NULL)
                                 err(1, NULL);                                  err(1, NULL);
                         tmp->when = f_time + v2 * SECSPERDAY;  
                           if (bodun && (day - tp->tm_yday) == -1) {
                                   tmp->when = f_time - 1 * SECSPERDAY;
                                   tmtmp.tm_mday++;
                                   tmp->bodun = 1;
                           } else {
                                   tmp->when = f_time + v2 * SECSPERDAY;
                                   tmp->bodun = 0;
                           }
   
                         (void)mktime(&tmtmp);                          (void)mktime(&tmtmp);
                         if (strftime(tmp->print_date,                          if (strftime(tmp->print_date,
                             sizeof(tmp->print_date),                              sizeof(tmp->print_date),
                         /*    "%a %b %d", &tm);  Skip weekdays */                          /*    "%a %b %d", &tm);  Skip weekdays */
                             "%b %d", &tmtmp) == 0)                              "%b %d", &tmtmp) == 0)
                                 tmp->print_date[sizeof(tmp->print_date) - 1] = '\0';                                  tmp->print_date[sizeof(tmp->print_date) - 1] = '\0';
                         if (bodun && (day - tp->tm_yday) == -1)  
                                 strcpy(tmp->prefix, "Бодун на утро от: ");  
                         else  
                                 tmp->prefix[0] = '\0';  
   
                         tmp->var   = varp;                          tmp->var   = varp;
                         tmp->next  = NULL;                          tmp->next  = NULL;
Line 539 
Line 544 
                                         /*    "%a %b %d", &tm);  Skip weekdays */                                          /*    "%a %b %d", &tm);  Skip weekdays */
                                             "%b %d", &tmtmp) == 0)                                              "%b %d", &tmtmp) == 0)
                                                 tmp->print_date[sizeof(tmp->print_date) - 1] = '\0';                                                  tmp->print_date[sizeof(tmp->print_date) - 1] = '\0';
                                         if (bodun && tdiff == -1)                                          tmp->bodun = bodun && tdiff == -1;
                                                 strcpy(tmp->prefix,  
                                                     "Bodun na ytpo ot: ");  
                                         else  
                                                 tmp->prefix[0] = '\0';  
                                         tmp->var   = varp;                                          tmp->var   = varp;
                                         tmp->next  = NULL;                                          tmp->next  = NULL;
                                         if (tmp2)                                          if (tmp2)
Line 564 
Line 565 
   
 int  int
 getmonth(s)  getmonth(s)
         register char *s;          char *s;
 {  {
         register char **p;          char **p;
         struct fixs *n;          struct fixs *n;
   
         for (n = fnmonths; n->name; ++n)          for (n = fnmonths; n->name; ++n)
Line 584 
Line 585 
   
 int  int
 getday(s)  getday(s)
         register char *s;          char *s;
 {  {
         register char **p;          char **p;
         struct fixs *n;          struct fixs *n;
   
         for (n = fndays; n->name; ++n)          for (n = fndays; n->name; ++n)
Line 608 
Line 609 
  */   */
 int  int
 getdayvar(s)  getdayvar(s)
         register char *s;          char *s;
 {  {
         register int offset;          int offset;
   
   
         offset = strlen(s);          offset = strlen(s);

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.14