Package: wmcalclock
Version: 1.25-14

The wmcalclock 30-hour time patch has a daylight savings time bug that causes the wrong date to be displayed for exactly one hour each year. Reproduce by running
  datefudge "2006-04-02 23:59:55" wmcalclock -30
and watching the date roll over from Apr. 2 to Apr. 1.

Here is a fix. (This algorithm has been tested against a 72-hour period surrounding both DST changes.)

--- wmcalclock-1.25.orig/debian/patches/02_30hr_patch.dpatch    2008-11-20 
19:49:36.000000000 -0500
+++ wmcalclock-1.25/debian/patches/02_30hr_patch.dpatch 2008-11-20 
19:55:37.000000000 -0500
@@ -30,7 +30,7 @@
 +        /* Careful.  Need to handle daylight savings time changes correctly. 
*/
 +        if (Time->tm_hour < 6){
 +            int old_hour = Time->tm_hour;
-+            time_t new_time = CurrentLocalTime - 24 * 60 * 60;
++            time_t new_time = CurrentLocalTime - 12 * 60 * 60;
 +            Time = localtime(&new_time);
 +            Time->tm_hour = old_hour + 24;
 +        }



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to