aboutsummaryrefslogtreecommitdiffstats
path: root/em-format/em-format.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-01-29 23:50:53 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-01-30 09:22:57 +0800
commit21ab8044dab93b6367463593628ec42befda4f67 (patch)
tree50948c4b0675041b615b5113d7b9176f2d71db99 /em-format/em-format.c
parent8fade835168c511a89813019aef6d0ee02d63b5d (diff)
downloadgsoc2013-evolution-21ab8044dab93b6367463593628ec42befda4f67.tar
gsoc2013-evolution-21ab8044dab93b6367463593628ec42befda4f67.tar.gz
gsoc2013-evolution-21ab8044dab93b6367463593628ec42befda4f67.tar.bz2
gsoc2013-evolution-21ab8044dab93b6367463593628ec42befda4f67.tar.lz
gsoc2013-evolution-21ab8044dab93b6367463593628ec42befda4f67.tar.xz
gsoc2013-evolution-21ab8044dab93b6367463593628ec42befda4f67.tar.zst
gsoc2013-evolution-21ab8044dab93b6367463593628ec42befda4f67.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'em-format/em-format.c')
-rw-r--r--em-format/em-format.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/em-format/em-format.c b/em-format/em-format.c
index 43c38c9179..cba7c765bc 100644
--- a/em-format/em-format.c
+++ b/em-format/em-format.c
@@ -1490,19 +1490,31 @@ add_validity_found (EMFormat *emf,
/* ********************************************************************** */
static void
-preserve_charset_in_content_type (CamelMimePart *ipart, CamelMimePart *opart)
+preserve_charset_in_content_type (CamelMimePart *ipart,
+ CamelMimePart *opart)
{
- CamelContentType *ict;
+ CamelDataWrapper *data_wrapper;
+ CamelContentType *content_type;
+ const gchar *charset;
g_return_if_fail (ipart != NULL);
g_return_if_fail (opart != NULL);
- ict = camel_data_wrapper_get_mime_type_field (camel_medium_get_content (CAMEL_MEDIUM (ipart)));
- if (!ict || !camel_content_type_param (ict, "charset") || !*camel_content_type_param (ict, "charset"))
+ data_wrapper = camel_medium_get_content (CAMEL_MEDIUM (ipart));
+ content_type = camel_data_wrapper_get_mime_type_field (data_wrapper);
+
+ if (content_type == NULL)
+ return;
+
+ charset = camel_content_type_param (content_type, "charset");
+
+ if (charset == NULL || *charset == '\0')
return;
- camel_content_type_set_param (camel_data_wrapper_get_mime_type_field (camel_medium_get_content (CAMEL_MEDIUM (opart))),
- "charset", camel_content_type_param (ict, "charset"));
+ data_wrapper = camel_medium_get_content (CAMEL_MEDIUM (opart));
+ content_type = camel_data_wrapper_get_mime_type_field (data_wrapper);
+
+ camel_content_type_set_param (content_type, "charset", charset);
}
#ifdef ENABLE_SMIME