Date: Wed, 26 Jan 2000 10:26:20 +0900 From: Shigeyuki Fukushima <shige@FreeBSD.org> To: current@FreeBSD.ORG Subject: groff(troff) y2k problem Message-ID: <14478.19772.658000.78716W@athena.sitc.toshiba.co.jp>
next in thread | raw e-mail | index | archive | help
I think, we should fix groff y2k problem before 4.0-Release time. # Also see the bottom line of `man hosts.equiv` ;), and # PRs gnu/4930, gnu/8321, bin/9502. GNU groff 1.15 has been already fixed for y2k. But groff imported in -current seems to have a y2k bug again. ;) Macros expect number register 'yr' to be the number of years since 1900. So, a fix with troff/input.cc on revision 1.2 to "perform modular division by 100 on yr number register" is harmful. The patch shown below fix this problems. ===== --- src/contrib/groff/troff/input.cc.orig Wed Jan 12 19:26:35 2000 +++ src/contrib/groff/troff/input.cc Wed Jan 26 10:19:50 2000 @@ -5558,7 +5558,7 @@ set_number_reg("dw", int(tt->tm_wday + 1)); set_number_reg("dy", int(tt->tm_mday)); set_number_reg("mo", int(tt->tm_mon + 1)); - set_number_reg("yr", int(tt->tm_year)%100); + set_number_reg("yr", int(tt->tm_year)); set_number_reg("$$", getpid()); number_reg_dictionary.define(".A", new constant_reg(ascii_output_flag ===== On the other hand, groff based on version 1.11 has had y2k bug yet on FreeBSD 3.4-RELEASE. It seems that the below patch is necessary. ===== --- src/contrib/groff/troff/input.cc.orig Sat Jul 24 09:46:32 1999 +++ src/contrib/groff/troff/input.cc Thu Jan 20 00:16:55 2000 @@ -5543,7 +5543,7 @@ set_number_reg("dw", int(tt->tm_wday + 1)); set_number_reg("dy", int(tt->tm_mday)); set_number_reg("mo", int(tt->tm_mon + 1)); - set_number_reg("yr", int(tt->tm_year)%100); + set_number_reg("yr", int(tt->tm_year)); set_number_reg("$$", getpid()); number_reg_dictionary.define(".A", new constant_reg(ascii_output_flag --- src/contrib/groff/mm/tmac.m.orig Tue May 18 12:38:35 1999 +++ src/contrib/groff/mm/tmac.m Thu Jan 20 17:38:54 2000 @@ -2620,8 +2620,8 @@ .de AE .. .\" I am planning to use mgm some time :-) -.ie \\n[yr]<50 .ds cov*new-date \\*[MO\\n[mo]] \\n[dy], 20\\n[yr] -.el .ds cov*new-date \\*[MO\\n[mo]] \\n[dy], 19\\n[yr] +.nr cov*year 1900+\n[yr] +.ds cov*new-date \*[MO\n[mo]] \n[dy], \n[cov*year] .als DT cov*new-date .de ND .ds cov*new-date \\$1 ===== --- shige To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14478.19772.658000.78716W>