Subject: pkg/32994: /usr/pkgsrc/math/sc will not show dates later than 1999
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: Jonathan <jdrews@cybox.com>
List: pkgsrc-bugs
Date: 03/04/2006 18:10:01
>Number:         32994
>Category:       pkg
>Synopsis:       package math/sc will not show dates later than Dec 31 1999
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 04 18:10:01 +0000 2006
>Originator:     Jonathan <jdrews@cybox.com>
>Release:        NetBSD 3.0
>Organization:
 	<organization of PR author (multiple lines)>
>Environment:
System: NetBSD netbsd.silbsd.org 3.0 NetBSD 3.0 (GENERIC) #0: Mon Dec 19 
01:04:02 UTC 2005 
builds@works.netbsd.org:/home/builds/ab/netbsd-3-0-RELEASE/i386/200512182024Z-obj/home/builds/ab/netbsd-3-0-RELEASE/src/sys/arch/i386/compile/GENERIC 
i386
Architecture: i386
Machine: i386
>Description:
 	Dates entered in the sc spreadsheet that are later than 31 
December 1999, using the
         command @dts(m,d,y), will not be displayed.
>How-To-Repeat:
 	1) start SC in a xterm; do $ sc
 	2) Format the column for dates do: f and then enter 10 0 3.
 	3) Now enter a recent date. Do: =@dts(3,12,2006) for 12 Mar 2006
 	4) The date will not show up.
>Fix:
 	Please apply the attached modified patch-ac.
--- interp.c.orig       1992-05-11 12:43:36.000000000 -0600
+++ interp.c    2006-03-04 10:34:11.000000000 -0700
@@ -476,7 +476,7 @@
  do dts(mo, day, yr)
  int mo, day, yr;
  {
-    long trial;
+    time_t trial;
      register struct tm *tp;
      register int i;
      register long jdate;
@@ -484,7 +484,7 @@
      mdays[1] = 28 + (yr%4 == 0);

      if (mo < 1 || mo > 12 || day < 1 || day > mdays[--mo] ||
-               yr > 1999 || yr < 1970) {
+               yr > 2010 || yr < 1970) {
         error("@dts: invalid argument");
         cellerror = CELLERROR;
         return(0.0);
@@ -551,15 +551,13 @@
  int which;
  double when;
  {
-       long time();
-
         static long t_cache;
         static struct tm tm_cache;
         struct tm *tp;
-       long tloc;
+       time_t tloc;

         if (which == NOW)
-           return (double)time((long *)0);
+           return (double)time(NULL);

         tloc = (long)when;

--0-159348039-1141495541=:14265
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=patch-ac
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.NEB.4.63.0603041105410.14265@netbsd.silbsd.org>
Content-Description: patch
Content-Disposition: attachment; filename=patch-ac

LS0tIGludGVycC5jLm9yaWcJMTk5Mi0wNS0xMSAxMjo0MzozNi4wMDAwMDAw
MDAgLTA2MDANCisrKyBpbnRlcnAuYwkyMDA2LTAzLTA0IDEwOjM0OjExLjAw
MDAwMDAwMCAtMDcwMA0KQEAgLTQ3Niw3ICs0NzYsNyBAQA0KIGRvZHRzKG1v
LCBkYXksIHlyKQ0KIGludCBtbywgZGF5LCB5cjsNCiB7DQotICAgIGxvbmcg
dHJpYWw7DQorICAgIHRpbWVfdCB0cmlhbDsNCiAgICAgcmVnaXN0ZXIgc3Ry
dWN0IHRtICp0cDsgDQogICAgIHJlZ2lzdGVyIGludCBpOw0KICAgICByZWdp
c3RlciBsb25nIGpkYXRlOw0KQEAgLTQ4NCw3ICs0ODQsNyBAQA0KICAgICBt
ZGF5c1sxXSA9IDI4ICsgKHlyJTQgPT0gMCk7DQogDQogICAgIGlmIChtbyA8
IDEgfHwgbW8gPiAxMiB8fCBkYXkgPCAxIHx8IGRheSA+IG1kYXlzWy0tbW9d
IHx8DQotCQl5ciA+IDE5OTkgfHwgeXIgPCAxOTcwKSB7DQorCQl5ciA+IDIw
MTAgfHwgeXIgPCAxOTcwKSB7DQogCWVycm9yKCJAZHRzOiBpbnZhbGlkIGFy
Z3VtZW50Iik7DQogCWNlbGxlcnJvciA9IENFTExFUlJPUjsNCiAJcmV0dXJu
KDAuMCk7DQpAQCAtNTUxLDE1ICs1NTEsMTMgQEANCiBpbnQgd2hpY2g7DQog
ZG91YmxlIHdoZW47DQogew0KLQlsb25nIHRpbWUoKTsNCi0NCiAJc3RhdGlj
IGxvbmcgdF9jYWNoZTsNCiAJc3RhdGljIHN0cnVjdCB0bSB0bV9jYWNoZTsN
CiAJc3RydWN0IHRtICp0cDsNCi0JbG9uZyB0bG9jOw0KKwl0aW1lX3QgdGxv
YzsNCiANCiAJaWYgKHdoaWNoID09IE5PVykgDQotCSAgICByZXR1cm4gKGRv
dWJsZSl0aW1lKChsb25nICopMCk7DQorCSAgICByZXR1cm4gKGRvdWJsZSl0
aW1lKE5VTEwpOw0KIA0KIAl0bG9jID0gKGxvbmcpd2hlbjsNCiANCg==

--0-159348039-1141495541=:14265--

>Unformatted:
   This message is in MIME format.  The first part should be readable text,
   while the remaining parts are likely unreadable without MIME-aware tools.
 
 --0-159348039-1141495541=:14265
 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed