dovecot-1.0: More fixes to SEARCH BEFORE/ON/SINCE timezone handl...

dovecot at dovecot.org dovecot at dovecot.org
Thu Feb 21 18:16:31 EET 2008


details:   http://hg.dovecot.org/dovecot-1.0/rev/68253f33f55c
changeset: 5520:68253f33f55c
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Feb 21 18:17:57 2008 +0200
description:
More fixes to SEARCH BEFORE/ON/SINCE timezone handling.

diffstat:

1 file changed, 5 insertions(+), 2 deletions(-)
src/lib-storage/index/index-search.c |    7 +++++--

diffs (32 lines):

diff -r b8b4ffa5fd6e -r 68253f33f55c src/lib-storage/index/index-search.c
--- a/src/lib-storage/index/index-search.c	Wed Feb 20 20:02:31 2008 +0200
+++ b/src/lib-storage/index/index-search.c	Thu Feb 21 18:17:57 2008 +0200
@@ -1,8 +1,8 @@
 /* Copyright (C) 2002 Timo Sirainen */
 
 #include "lib.h"
-#include "ioloop.h"
 #include "istream.h"
+#include "utc-offset.h"
 #include "str.h"
 #include "message-address.h"
 #include "message-date.h"
@@ -183,6 +183,7 @@ static int search_arg_match_cached(struc
 				   enum mail_search_arg_type type,
 				   const char *value)
 {
+	struct tm *tm;
 	time_t date, search_time;
 	uoff_t virtual_size, search_size;
 	int timezone_offset;
@@ -195,7 +196,9 @@ static int search_arg_match_cached(struc
 		date = mail_get_received_date(ctx->mail);
 		if (date == (time_t)-1)
 			return -1;
-		date -= ioloop_timezone.tz_minuteswest*60;
+
+		tm = localtime(&date);
+		date += utc_offset(tm, date)*60;
 
 		if (!imap_parse_date(value, &search_time))
 			return 0;


More information about the dovecot-cvs mailing list