1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-23 04:23:08 +00:00
freebsd-ports/japanese/mh/files/patch-al
Motoyuki Konno 3a7c9e3d91 Fix some problems.
o  Y2K problem.
  o  repl coredump problem.

Submitted by:	mh-plus project (japanese/mh developper)
2000-03-11 00:47:03 +00:00

39 lines
1.2 KiB
Plaintext

--- zotnet/tws/dtime.c.orig Tue Feb 9 20:30:00 1999
+++ zotnet/tws/dtime.c Tue Jan 4 20:46:46 2000
@@ -170,7 +170,7 @@
tw.tw_hour = tm -> tm_hour;
tw.tw_mday = tm -> tm_mday;
tw.tw_mon = tm -> tm_mon;
- tw.tw_year = tm -> tm_year + CENTURY;
+ tw.tw_year = tm -> tm_year + 1900;
tw.tw_wday = tm -> tm_wday;
tw.tw_yday = tm -> tm_yday;
if (tm -> tm_isdst)
@@ -212,7 +212,7 @@
tw.tw_hour = tm -> tm_hour;
tw.tw_mday = tm -> tm_mday;
tw.tw_mon = tm -> tm_mon;
- tw.tw_year = tm -> tm_year + CENTURY;
+ tw.tw_year = tm -> tm_year + 1900;
tw.tw_wday = tm -> tm_wday;
tw.tw_yday = tm -> tm_yday;
if (tm -> tm_isdst)
@@ -370,12 +370,14 @@
|| (min = tw -> tw_min) < 0 || min > 59
|| (hour = tw -> tw_hour) < 0 || hour > 23
|| (mday = tw -> tw_mday) < 1 || mday > 31
- || (mon = tw -> tw_mon + 1) < 1 || mon > 12)
+ || (mon = tw -> tw_mon + 1) < 1 || mon > 12
+ || (year = tw -> tw_year) < 0)
return (tw -> tw_clock = -1L);
- year = tw -> tw_year;
result = 0L;
- if (year < 100)
+ if (year < 69)
+ year += CENTURY + 100;
+ else if (year < 100)
year += CENTURY;
for (i = 1970; i < year; i++)
result += dysize (i);