mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-26 05:02:18 +00:00
3a7c9e3d91
o Y2K problem. o repl coredump problem. Submitted by: mh-plus project (japanese/mh developper)
35 lines
855 B
Plaintext
35 lines
855 B
Plaintext
--- zotnet/tws/dtimep.lex.orig Tue Feb 9 20:30:00 1999
|
|
+++ zotnet/tws/dtimep.lex Tue Jan 4 11:32:43 2000
|
|
@@ -181,6 +181,7 @@
|
|
|
|
/* Zero out the struct. */
|
|
bzero( (char *) &tw, sizeof tw);
|
|
+ tw.tw_year = -1;
|
|
|
|
/* Set default time zone. */
|
|
#ifdef ZONEINFO
|
|
@@ -205,17 +206,19 @@
|
|
switch (cp = str, *cp ? lex_string( &str, start_cond) : 0) {
|
|
|
|
case -1:
|
|
- if (!gotdate || tw.tw_year == 0)
|
|
+ if (!gotdate || tw.tw_year == -1)
|
|
return (struct tws *)0;
|
|
/* fall through */
|
|
case 0:
|
|
- if ( tw.tw_year == 0 ) {
|
|
+ if ( tw.tw_year == -1 ) {
|
|
/* Set default year. */
|
|
time (&tclock);
|
|
tw.tw_year = localtime(&tclock)->tm_year + 1900;
|
|
}
|
|
+ else if (tw.tw_year < 69) {
|
|
+ tw.tw_year += 2000;
|
|
+ }
|
|
else if (tw.tw_year < 100) {
|
|
- /* assume no 2-digit years > 1999 */
|
|
tw.tw_year += 1900;
|
|
}
|
|
return &tw;
|
|
|