From sime@logos.hr  Mon Mar 27 09:13:10 2006
Return-Path: <sime@logos.hr>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5B76516A420
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 27 Mar 2006 09:13:10 +0000 (UTC)
	(envelope-from sime@logos.hr)
Received: from mail.logos.hr (gates.logos.hr [213.149.47.2])
	by mx1.FreeBSD.org (Postfix) with ESMTP id E2CE243D4C
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 27 Mar 2006 09:13:09 +0000 (GMT)
	(envelope-from sime@logos.hr)
Received: from localhost (localhost.logos.hr [127.0.0.1])
	by mail.logos.hr (Postfix) with ESMTP id 1677726D03F
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 27 Mar 2006 11:13:08 +0200 (CEST)
Received: from mail.logos.hr ([127.0.0.1])
 by localhost (mail.logos.hr [127.0.0.1]) (amavisd-new, port 10024) with LMTP
 id 12140-04-6 for <FreeBSD-gnats-submit@freebsd.org>;
 Mon, 27 Mar 2006 11:12:59 +0200 (CEST)
Received: by mail.logos.hr (Postfix, from userid 34062)
	id E77BC26D04A; Mon, 27 Mar 2006 11:12:59 +0200 (CEST)
Message-Id: <20060327091259.E77BC26D04A@mail.logos.hr>
Date: Mon, 27 Mar 2006 11:12:59 +0200 (CEST)
From: Simun Mikecin <numisemis@yahoo.com>
Reply-To: Simun Mikecin <numisemis@yahoo.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [MAINTAINER UPDATE] lang/see: Correct incorrect timezone calculation
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         94996
>Category:       ports
>Synopsis:       [MAINTAINER UPDATE] lang/see: Correct incorrect timezone calculation
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 27 09:20:12 GMT 2006
>Closed-Date:    Tue Apr 11 15:40:47 GMT 2006
>Last-Modified:  Tue Apr 11 15:40:47 GMT 2006
>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:
State-Changed-From-To: open->closed 
State-Changed-By: garga 
State-Changed-When: Tue Apr 11 15:40:46 UTC 2006 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=94996 
>Unformatted:
