dovecot-2.0: utc_offset() was broken with year's first/last day ...
dovecot at dovecot.org
dovecot at dovecot.org
Tue Jul 21 22:18:54 EEST 2009
details: http://hg.dovecot.org/dovecot-2.0/rev/22ede7ce7be4
changeset: 9647:22ede7ce7be4
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 d1c159e447a2 -r 22ede7ce7be4 src/lib/utc-offset.c
--- a/src/lib/utc-offset.c Tue Jul 21 15:01: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