changeset 6910:c68564884bae HEAD

charset_to_utf8_begin() was called with bad flags parameter (although it just happened to be the same value, so it worked).
author Timo Sirainen <tss@iki.fi>
date Mon, 03 Dec 2007 14:23:19 +0200
parents 725a31acbe00
children a215deb3de8d
files src/lib-mail/message-decoder.c src/lib-mail/message-header-decode.c
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-mail/message-decoder.c	Mon Dec 03 14:22:27 2007 +0200
+++ b/src/lib-mail/message-decoder.c	Mon Dec 03 14:23:19 2007 +0200
@@ -214,14 +214,16 @@
 				struct message_block *output)
 {
 	unsigned char new_buf[MAX_ENCODING_BUF_SIZE+1];
+	enum charset_flags flags;
 	const unsigned char *data = NULL;
 	size_t pos, size = 0, skip = 0;
 	int ret;
 
 	if (ctx->charset_trans == NULL && !ctx->charset_utf8) {
+		flags = ctx->dtcase ? CHARSET_FLAG_DECOMP_TITLECASE : 0;
 		if (charset_to_utf8_begin(ctx->content_charset != NULL ?
 					  ctx->content_charset : "UTF-8",
-					  ctx->dtcase, &ctx->charset_trans) < 0)
+					  flags, &ctx->charset_trans) < 0)
 			ctx->charset_trans = NULL;
 	}
 
--- a/src/lib-mail/message-header-decode.c	Mon Dec 03 14:22:27 2007 +0200
+++ b/src/lib-mail/message-header-decode.c	Mon Dec 03 14:23:19 2007 +0200
@@ -128,6 +128,7 @@
 {
 	struct decode_utf8_context *ctx = context;
 	struct charset_translation *t;
+	enum charset_flags flags;
 
 	/* one call with charset=NULL means nothing changed */
 	if (!ctx->called && charset == NULL)
@@ -146,7 +147,8 @@
 		return TRUE;
 	}
 
-	if (charset_to_utf8_begin(charset, ctx->dtcase, &t) < 0) {
+	flags = ctx->dtcase ? CHARSET_FLAG_DECOMP_TITLECASE : 0;
+	if (charset_to_utf8_begin(charset, flags, &t) < 0) {
 		/* let's just ignore this part */
 		return TRUE;
 	}