From: egil@kvaleberg.no (Egil Kvaleberg) There is in fact a similar problem elsewhere. Since my version of cnews seems to be somewhat differently organized anyway, I've enclosed a complete patch for these two cases. Note also that this utterly evident method of handling 2 digit years is rumored to be covered by some US patent - then again, since the outcome is a number offset 1900 and not a 4 digit year - it may be not. Regretfully, this senseless patent system seems to be paving its way to Europe to. Perhaps we can agree upon a new years resolution of working to try to get rid of this menace in form of the institution of software patents. A treat to any self respecting programmer that has not lost the ability to think for himself, and still has some pride left. Egil ------------- snip --------------------------- *** libc/getabsdate.c.orig Tue Dec 10 23:23:05 1991 --- libc/getabsdate.c Sat Jan 1 16:54:46 2000 *************** *** 116,121 **** case YEAR: tm->tm_year = bigval; /* convert 4-digit year to 1900 origin */ ! if (tm->tm_year >= 1900) tm->tm_year -= 1900; break; --- 116,126 ---- case YEAR: tm->tm_year = bigval; + + /* convert 2-digit year 20xx to 1900 origin */ + if (tm->tm_year < 70) /* y2k */ + tm->tm_year += 100; + /* convert 4-digit year to 1900 origin */ ! else if (tm->tm_year >= 1900) tm->tm_year -= 1900; break; *** libc/getindate.c.orig Tue Dec 10 23:24:29 1991 --- libc/getindate.c Sat Jan 1 17:04:15 2000 *************** *** 150,156 **** tm->tm_year = atoi(line); ! if (tm->tm_year <= 0) return -1; /* year is non-positive or missing */ ! if (tm->tm_year >= 1900) /* convert year to 1900 origin, */ tm->tm_year -= 1900; /* but 2-digit years need no work */ SKIPOVER(line); /* skip year */ --- 150,159 ---- tm->tm_year = atoi(line); ! if (tm->tm_year < 0 || !isdigit(*line)) return -1; /* year is non-positive or missing */ ! ! if (tm->tm_year < 70) /* year is 2000 origin? */ ! tm->tm_year += 100; /* make 1900 origin y2k */ ! else if (tm->tm_year >= 1900) /* convert year to 1900 origin, */ tm->tm_year -= 1900; /* but 2-digit years need no work */ SKIPOVER(line); /* skip year */ ---------------------------------------------- -- Email: egil@kvaleberg.no Voice: +47 22523641, 92022780 Fax: +47 22525899 Mail: Egil Kvaleberg, Husebybakken 14A, 0379 Oslo, Norway Home: http://www.kvaleberg.no/