Subject: unexpected y2k problems

From: "Alex Shvedov" <[email-masked]>
Date: Thu, 6 Jan 2000 17:09:17 -0500

We encountered problems with date parsing. Experiments were made
with c-client ver. 4.6. Problems are illustrated in the sample
code below (attached file is not in CR-LF but LF-only format).

In two words, when the year is presented by 2 last digits, 99 and
01 work fine and bring correct results, while 00 causes error.

Any ideas?

---

From: Mark Crispin <[email-masked]>
Date: Thu, 6 Jan 2000 15:56:47 -0800 (PST)

Like all other 2-digit years, 00 is an error, and it has been an error for the
past 10 years.  It just started getting enforced.  Use 4-digit years from now
on.

The following patch will give you reclama for 00.

Once again, this is not a bug fix; it is merely reclama for messages from MUAs
which use 2-digit years.  These MUAs should have been fixed 10 years ago.
Even with this reclama, the axe will fall eventually.

*** mail.c~	Tue Jan  4 17:13:18 2000
--- mail.c	Wed Jan  5 11:46:13 2000
***************
*** 2247,2255 ****
  				/* error if delimiter not here */
        if (mi != *s++) return NIL;
      }
!     if ((y = strtoul ((const char *) s,&s,10)) && (*s == '\0' || *s == ' '))
!       break;			/* successfully parsed year */
!   default: return NIL;		/* unknown date format */
    }
  				/* minimal validity check of date */
    if ((d > 31) || (m > 12)) return NIL;
--- 2250,2262 ----
  				/* error if delimiter not here */
        if (mi != *s++) return NIL;
      }
!     while (*s == ' ') s++;	/* parse year */
!     if (isdigit (*s)) {		/* must be a digit here */
!       y = strtoul ((const char *) s,&s,10);
!       if (*s == '\0' || *s == ' ') break;
!     }
!   default:
!     return NIL;			/* unknown date format */
    }
  				/* minimal validity check of date */
    if ((d > 31) || (m > 12)) return NIL;