zdump loop problem

Robbin Kawabata Robbin.Kawabata at Sun.COM
Mon Dec 8 19:50:37 UTC 2008


I ran ado's fix against all the timezones, and got good results.

This is the diff:

*** zdump_loop.c    Tue Dec  2 11:17:01 2008
--- zdump_fix_ado.c     Tue Dec  2 12:49:05 2008
***************
*** 312,322 ****
                        (void) strncpy(buf, abbr(&tm), sizeof (buf) - 1);
                }
                for (;;) {
!                       if (t >= cuthitime)
                                break;
                        newt = t + SECSPERHOUR * 12;
-                       if (newt >= cuthitime)
-                               break;
                        if (newt <= t)
                                break;
                        newtmp = localtime(&newt);
--- 312,320 ----
                        (void) strncpy(buf, abbr(&tm), sizeof (buf) - 1);
                }
                for (;;) {
!                       if (t >= cuthitime || t >= cuthitime - SECSPERHOUR * 12)
                                break;
                        newt = t + SECSPERHOUR * 12;
                        if (newt <= t)
                                break;
                        newtmp = localtime(&newt);


However, isn't the check for "if (newt <= t) break" no longer needed?

----- Begin Forwarded Message -----

Date: Mon, 01 Dec 2008 16:21:00 -0500
From: "Olson, Arthur David (NIH/NCI) [E]" <olsona at dc37a.nci.nih.gov>
Subject: Re: zdump loop problem
To: tz at lecserver.nci.nih.gov
Cc: Andreas Radke <a.radke at arcor.de>

So...in the real world, does changing the zic.c lines reading...
			if (t >= cuthitime)
				break;
			newt = t + SECSPERHOUR * 12;
			if (newt >= cuthitime)
				break;
...to read...
			if (t >= cuthitime || t >= cuthitime -
SECSPERHOUR * 12)
				break;
			newt = t + SECSPERHOUR * 12;
...result in working code? I'd particularly appreciate feedback from
Andreas Radke or other ArchLinux users.

----- End Forwarded Message -----





More information about the tz mailing list