Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Mar 2006 11:12:59 +0200 (CEST)
From:      Simun Mikecin <numisemis@yahoo.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/94996: [MAINTAINER UPDATE] lang/see: Correct incorrect timezone calculation
Message-ID:  <20060327091259.E77BC26D04A@mail.logos.hr>
Resent-Message-ID: <200603270920.k2R9KCe5053510@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         94996
>Category:       ports
>Synopsis:       [MAINTAINER UPDATE] lang/see: Correct incorrect timezone calculation
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 27 09:20:12 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Simun Mikecin
>Release:        FreeBSD 5.2.1-RELEASE-p9 i386
>Organization:
>Environment:
System: FreeBSD mail.logos.hr 5.2.1-RELEASE-p9 FreeBSD 5.2.1-RELEASE-p9 #1: Mon Jul 26 14:07:00 CEST 2004 root@mail.logos.hr:/usr/obj/usr/src.5.2.1-R/sys/MAIL i386


	
>Description:
If summer-time daylight saving is in effect, getHours() returns wrong value.

>How-To-Repeat:
	$ see-shell
	> var a = new Date();
	 = undefined
	> a.getHours();
	 = 11
>Fix:
diff -urN see.orig/Makefile see/Makefile
--- see.orig/Makefile	Wed Feb  1 12:46:17 2006
+++ see/Makefile	Mon Mar 27 10:59:07 2006
@@ -7,6 +7,7 @@
 
 PORTNAME=	see
 PORTVERSION=	1.3.1
+PORTREVISION=	1
 CATEGORIES=	lang devel
 MASTER_SITES=	http://www.adaptive-enterprises.com.au/~d/software/see/
 
diff -urN see.orig/files/patch-libsee_obj__Date.c see/files/patch-libsee_obj__Date.c
--- see.orig/files/patch-libsee_obj__Date.c	Thu Jan  1 01:00:00 1970
+++ see/files/patch-libsee_obj__Date.c	Mon Mar 27 10:58:04 2006
@@ -0,0 +1,35 @@
+--- libsee/obj_Date.c.orig	Wed Jan 18 13:51:50 2006
++++ libsee/obj_Date.c	Mon Mar 27 10:56:41 2006
+@@ -2167,20 +2167,12 @@
+ DaylightSavingTA(t)
+ 	SEE_number_t t;
+ {
+-	SEE_number_t ysec = t - TimeFromYear((SEE_number_t)YearFromTime(t));
+-	int ily = InLeapYear(t);
+-	int wstart = WeekDay(TimeFromYear((SEE_number_t)YearFromTime(t)));
+-	int equiv_year = yearmap[ily][wstart];
+ 	struct tm tm;
+ 	time_t dst_time, nodst_time;
++	time_t tt;
++        tt=t/1000;
++        tm=*localtime(&tt);
+ 
+-	memset(&tm, 0, sizeof tm);
+-	tm.tm_sec = SecFromTime(ysec);
+-	tm.tm_min = MinFromTime(ysec);
+-	tm.tm_hour = HourFromTime(ysec);
+-	tm.tm_mday = DateFromTime(ysec);
+-	tm.tm_mon = MonthFromTime(ysec) - 1;
+-	tm.tm_year = equiv_year - 1900;
+ 	tm.tm_isdst = -1;
+ 
+ 	if (tm.tm_isdst == 0) return 0;
+@@ -2189,7 +2181,7 @@
+ 	tm.tm_isdst = 0;
+ 	nodst_time = mktime(&tm);
+ 
+-	return (dst_time - nodst_time) * 1000;
++	return -(dst_time - nodst_time) * 1000;
+ }
+ 
+ static void
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060327091259.E77BC26D04A>