[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.7 and 1.10

version 1.7, 1998/12/13 07:31:07 version 1.10, 1999/11/25 03:46:46
Line 248 
Line 248 
  *      3-charweekday                   (Friday, Monday, mon.)   *      3-charweekday                   (Friday, Monday, mon.)
  *      numeric month or day            (1, 2, 04)   *      numeric month or day            (1, 2, 04)
  *   *
  * Any character may separate them, or they may not be separated.  Any line,   * Any character except \t or '*' may separate them, or they may not be
  * following a line that is matched, that starts with "whitespace", is shown   * separated.  Any line following a line that is matched, that starts
  * along with the matched line.   * with \t, is shown along with the matched line.
  */   */
 struct match *  struct match *
 isnow(endp)  isnow(endp)
Line 404 
Line 404 
                         memcpy(&tmtmp, tp, sizeof(struct tm));                          memcpy(&tmtmp, tp, sizeof(struct tm));
                         tmtmp.tm_mday = dayp;                          tmtmp.tm_mday = dayp;
                         tmtmp.tm_mon = monthp - 1;                          tmtmp.tm_mon = monthp - 1;
                           if (vwd) {
                           /* We want the event next year if it's late now
                            * this year.  The 50-day limit means we don't have to
                            * worry if next year is or isn't a leap year.
                            */
                                   if (tp->tm_yday > 300 && tmtmp.tm_mon <= 1)
                                           variable_weekday(&vwd, tmtmp.tm_mon + 1,
                                               tmtmp.tm_year + TM_YEAR_BASE + 1);
                                   else
                                           variable_weekday(&vwd, tmtmp.tm_mon + 1,
                                               tmtmp.tm_year + TM_YEAR_BASE);
                                   day = cumdays[tmtmp.tm_mon + 1] + vwd;
                                   tmtmp.tm_mday = vwd;
                           }
                         v2 = day - tp->tm_yday;                          v2 = day - tp->tm_yday;
                         if ((v2 > v1) || (v2 < 0)) {                          if ((v2 > v1) || (v2 < 0)) {
                                 if ((v2 += isleap(tp->tm_year + TM_YEAR_BASE) ? 366 : 365)                                  if ((v2 += isleap(tp->tm_year + TM_YEAR_BASE) ? 366 : 365)
Line 484 
Line 498 
                                 if (flags & F_SPECIAL) {                                  if (flags & F_SPECIAL) {
                                         tmtmp.tm_mon = 0;       /* Gee, mktime() is nice */                                          tmtmp.tm_mon = 0;       /* Gee, mktime() is nice */
                                         tmtmp.tm_mday = spev[v1].getev(tmtmp.tm_year +                                          tmtmp.tm_mday = spev[v1].getev(tmtmp.tm_year +
                                             vwd + TM_YEAR_BASE);                                              TM_YEAR_BASE) + vwd;
                                 } else if (vwd) {                                  } else if (vwd) {
                                         v1 = vwd;                                          v1 = vwd;
                                         variable_weekday(&v1, tmtmp.tm_mon + 1,                                          variable_weekday(&v1, tmtmp.tm_mon + 1,

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.10