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

Diff for /src/usr.bin/at/parsetime.c between version 1.8 and 1.9

version 1.8, 1999/03/21 04:04:42 version 1.9, 2000/01/05 08:06:25
Line 443 
Line 443 
         struct tm *tm;          struct tm *tm;
         int mday, mon, year;          int mday, mon, year;
 {  {
         if (year > 99) {  
             if (year >= TM_YEAR_BASE)          /*
                     year -= TM_YEAR_BASE;           * Convert year into tm_year format (year - 1900).
             else           * We may be given the year in 2 digit, 4 digit, or tm_year format.
                     panic("garbled time");           */
         } else if (year != -1) {          if (year != -1) {
                 /*                  if (year >= TM_YEAR_BASE)
                  * check if the specified year is in the next century.                          year -= TM_YEAR_BASE;   /* convert from 4 digit year */
                  * allow for one year of user error as many people will                  else if (year < 100) {
                  * enter n - 1 at the start of year n.                          /* Convert to tm_year assuming current century */
                  */                          year += (tm->tm_year / 100) * 100;
                 if (year < tm->tm_year % 100 - 1)  
                         year += 100;                          if (year == tm->tm_year - 1)
                 /* adjust for the year 2000 and beyond */                                  year++;         /* Common off by one error */
                 year += tm->tm_year - (tm->tm_year % 100);                          else if (year < tm->tm_year)
                                   year += 100;    /* must be in next century */
                   }
         }          }
   
         if (year < 0 &&          if (year < 0 &&

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9