[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.3 and 1.4

version 1.3, 1998/02/23 05:48:42 version 1.4, 1998/03/30 06:59:26
Line 147 
Line 147 
         time_t now;          time_t now;
 {  {
         tp = localtime(&now);          tp = localtime(&now);
         if (isleap(tp->tm_year + 1900)) {          if (isleap(tp->tm_year + TM_YEAR_BASE)) {
                 yrdays = DAYSPERLYEAR;                  yrdays = DAYSPERLYEAR;
                 cumdays = daytab[1];                  cumdays = daytab[1];
         } else {          } else {
Line 172 
Line 172 
     char *date;      char *date;
 {  {
     time_t t;      time_t t;
     char save;  
     int len;      int len;
     struct tm tm;      struct tm tm;
   
Line 204 
Line 203 
         *(date + len - 4) = '\0';          *(date + len - 4) = '\0';
         tm.tm_year = atoi(date);          tm.tm_year = atoi(date);
   
         /* tm_year up 1900 ... */          /* tm_year up TM_YEAR_BASE ... */
         if (tm.tm_year > 1900)          if (tm.tm_year < 70)
             tm.tm_year -= 1900;                  tm.tm_year += 2000 - TM_YEAR_BASE;
           else if (tm.tm_year < 100)
                   tm.tm_year += 1900 - TM_YEAR_BASE;
           else if (tm.tm_year > TM_YEAR_BASE)
                   tm.tm_year -= TM_YEAR_BASE;
     }      }
   
 #if DEBUG  #if DEBUG

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4