zic mishandles `u'-format UNTIL (+ patch)

Paul Eggert eggert at twinsun.com
Wed May 29 22:48:03 UTC 1996


While preparing some proposed patches to historical data for Belfast,
Dublin, and London, I noticed that zic miscompiles the latest tz
data's March 1996 transition for Europe/Lisbon.  Here's the line
that is miscompiled:

# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
			 1:00	EU	MET%s	1996 Mar 31 1:00u

Here is the zdump output:

Europe/Lisbon  Sat Mar 30 23:59:59 1996 GMT = Sun Mar 31 00:59:59 1996 MET isdst=0
Europe/Lisbon  Sun Mar 31 00:00:00 1996 GMT = Sun Mar 31 01:00:00 1996 WET DST isdst=1

The transition should occur at 01:00 UTC, not 00:00 UTC.

Here is a proposed patch.

===================================================================
RCS file: RCS/zic.c,v
retrieving revision 1996.8
retrieving revision 1996.8.1.1
diff -c -r1996.8 -r1996.8.1.1
*** zic.c	1996/05/16 18:00:12	1996.8
--- zic.c	1996/05/29 21:29:04	1996.8.1.1
***************
*** 1694,1704 ****
  		** Now we may get to set starttime for the next zone line.
  		*/
  		if (useuntil) {
- 			starttime = tadd(zp->z_untiltime, -gmtoff);
  			startttisstd = zp->z_untilrule.r_todisstd;
  			startttisgmt = zp->z_untilrule.r_todisgmt;
  			if (!startttisstd)
  				starttime = tadd(starttime, -stdoff);
  		}
  	}
  	writezone(zpfirst->z_name);
--- 1694,1706 ----
  		** Now we may get to set starttime for the next zone line.
  		*/
  		if (useuntil) {
  			startttisstd = zp->z_untilrule.r_todisstd;
  			startttisgmt = zp->z_untilrule.r_todisgmt;
+ 			starttime = zp->z_untiltime;
  			if (!startttisstd)
  				starttime = tadd(starttime, -stdoff);
+ 			if (!startttisgmt)
+ 				starttime = tadd(starttime, -gmtoff);
  		}
  	}
  	writezone(zpfirst->z_name);



More information about the tz mailing list