zic produces wrong POSIX style TZ

Andreas Schwab aschwab at redhat.com
Tue Jun 23 10:06:20 UTC 2009


The current Bangladesh time zone description is unusual in that it ends
with being continuously in DST.  This uncovered a bug in zic, which
infers a POSIX TZ string of BDST-6 from the rule.  This is wrong since a
time zone that is continuously in DST cannot be expressed by POSIX
rules, so zic should not try to generate such a string.

Andreas.

--- zic.c.~1~	2009-04-20 22:17:54.000000000 +0200
+++ zic.c	2009-06-22 18:35:10.000000000 +0200
@@ -1921,7 +1921,7 @@ const int			zonecount;
 		if (stdrp != NULL && stdrp->r_hiyear == 2037)
 			return;
 	}
-	if (stdrp == NULL && zp->z_nrules != 0)
+	if (stdrp == NULL && (zp->z_nrules != 0 || zp->z_stdoff != 0))
 		return;
 	abbrvar = (stdrp == NULL) ? "" : stdrp->r_abbrvar;
 	doabbr(result, zp->z_format, abbrvar, FALSE, TRUE);

-- 
Andreas Schwab, aschwab at redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E
"And now for something completely different."




More information about the tz mailing list