Update zic from tzcode 2013b

Joseph S. Myers joseph@codesourcery.com
Tue Mar 12 23:55:00 GMT 2013


This patch updates zic.c from the latest tzcode release.  (All other
files from tzcode are unchanged there from the last git version we
imported into glibc.)

Tested x86_64.

2013-03-12  Joseph Myers  <joseph@codesourcery.com>

	* timezone/zic.c: Update from tzcode 2013b.

diff --git a/timezone/zic.c b/timezone/zic.c
index a5202a1..91f0d20 100644
--- a/timezone/zic.c
+++ b/timezone/zic.c
@@ -1748,7 +1748,7 @@ stringoffset(char *result, long offset)
 	minutes = offset % MINSPERHOUR;
 	offset /= MINSPERHOUR;
 	hours = offset;
-	if (hours >= HOURSPERDAY) {
+	if (hours > HOURSPERDAY) {
 		result[0] = '\0';
 		return -1;
 	}
@@ -1851,7 +1851,9 @@ stringzone(char *result, const struct zone *const zpfirst, const int zonecount)
 			rp = &zp->z_rules[i];
 			if (stdrp == NULL || rp->r_hiyear > stdrp->r_hiyear ||
 				(rp->r_hiyear == stdrp->r_hiyear &&
-				rp->r_month > stdrp->r_month))
+				(rp->r_month > stdrp->r_month ||
+				(rp->r_month == stdrp->r_month &&
+				rp->r_dayofmonth > stdrp->r_dayofmonth))))
 					stdrp = rp;
 		}
 		if (stdrp != NULL && stdrp->r_stdoff != 0)

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list