]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
use int32_t instead of int in struct mail_sent_date
authorTimo Sirainen <tss@iki.fi>
Sun, 24 Aug 2003 07:03:22 +0000 (10:03 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 24 Aug 2003 07:03:22 +0000 (10:03 +0300)
--HG--
branch : HEAD

src/lib-index/mail-cache.h
src/lib-storage/index/index-mail-headers.c
src/lib-storage/index/index-mail.c

index cc2721a81ad5fa9322c48c75ea44aff4a963c60b..ee618c091d56ce67ceabc2fcfdf0d3dff302629d 100644 (file)
@@ -51,7 +51,7 @@ enum mail_cache_field {
 
 struct mail_sent_date {
        time_t time;
-       int timezone;
+       int32_t timezone;
 };
 
 extern enum mail_cache_field mail_cache_header_fields[MAIL_CACHE_HEADERS_COUNT];
index 24f71134b286a9d6744f396216d964c0af3fdf4a..ba1f63ba40a1884e48194a275c27bacc14e4e19b 100644 (file)
@@ -265,6 +265,7 @@ void index_mail_parse_header(struct message_part *part,
        struct index_mail *mail = context;
        struct index_mail_data *data = &mail->data;
        struct cached_header *cached_hdr;
+       int timezone;
 
        if (data->bodystructure_header_parse)
                imap_bodystructure_parse_header(mail->pool, part, hdr);
@@ -311,11 +312,12 @@ void index_mail_parse_header(struct message_part *part,
                        if (!message_date_parse(hdr->full_value,
                                                hdr->full_value_len,
                                                &data->sent_date.time,
-                                               &data->sent_date.timezone)) {
+                                               &timezone)) {
                                /* 0 == parse error */
                                data->sent_date.time = 0;
-                               data->sent_date.timezone = 0;
+                               timezone = 0;
                        }
+                        data->sent_date.timezone = timezone;
                        data->save_sent_date = FALSE;
                }
        }
index 4df6d41534eaad10258a7f3237f0b22bb41288c9..38f51e196836f55bda04bfc7fac2de6c98939710 100644 (file)
@@ -263,6 +263,7 @@ static time_t get_date(struct mail *_mail, int *timezone)
        struct index_mail *mail = (struct index_mail *) _mail;
        struct index_mail_data *data = &mail->data;
        const char *str;
+       int tz;
 
        if (data->sent_date.time != (time_t)-1) {
                if (timezone != NULL)
@@ -278,12 +279,12 @@ static time_t get_date(struct mail *_mail, int *timezone)
                str = _mail->get_header(_mail, "Date");
                if (data->sent_date.time == (time_t)-1) {
                        if (!message_date_parse(str, (size_t)-1,
-                                               &data->sent_date.time,
-                                               &data->sent_date.timezone)) {
+                                               &data->sent_date.time, &tz)) {
                                /* 0 == parse error */
                                data->sent_date.time = 0;
-                               data->sent_date.timezone = 0;
+                               tz = 0;
                        }
+                        data->sent_date.timezone = tz;
                        index_mail_cache_add(mail, MAIL_CACHE_SENT_DATE,
                                             &data->sent_date,
                                             sizeof(data->sent_date));