dovecot-1.1: utc_offset() was broken with year's first/last day ...
dovecot at dovecot.org
dovecot at dovecot.org
Tue Jul 21 22:19:32 EEST 2009
details: http://hg.dovecot.org/dovecot-1.1/rev/ec60b22595a9
changeset: 8324:ec60b22595a9
user: Timo Sirainen <tss at iki.fi>
date: Tue Jul 21 15:18:49 2009 -0400
description:
utc_offset() was broken with year's first/last day if struct tm.tm_gmtoff didn't exist.
diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
src/lib/utc-offset.c | 6 ++++--
diffs (17 lines):
diff -r 6c9713778843 -r ec60b22595a9 src/lib/utc-offset.c
--- a/src/lib/utc-offset.c Thu Jul 09 22:49:05 2009 -0400
+++ b/src/lib/utc-offset.c Tue Jul 21 15:18:49 2009 -0400
@@ -19,9 +19,11 @@ int utc_offset(struct tm *tm, time_t t A
gtm = *tm;
/* max offset of 24 hours */
- if (ltm.tm_yday < gtm.tm_yday)
+ if ((ltm.tm_yday < gtm.tm_yday && ltm.tm_year == gtm.tm_year) ||
+ ltm.tm_year < gtm.tm_year)
offset = -24 * 60;
- else if (ltm.tm_yday > gtm.tm_yday)
+ else if ((ltm.tm_yday > gtm.tm_yday && ltm.tm_year == gtm.tm_year) ||
+ ltm.tm_year > gtm.tm_year)
offset = 24 * 60;
else
offset = 0;
More information about the dovecot-cvs
mailing list