aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@novell.com>2004-09-03 04:10:01 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-09-03 04:10:01 +0800
commitbb38060bedf396bdbfbf43b4469a7cea049c8338 (patch)
treed3045e857fb1512b241c6cf756f73083c09e47d6
parent36d36f16118ddc854462126e5bb6be04bb525c8d (diff)
downloadgsoc2013-evolution-bb38060bedf396bdbfbf43b4469a7cea049c8338.tar
gsoc2013-evolution-bb38060bedf396bdbfbf43b4469a7cea049c8338.tar.gz
gsoc2013-evolution-bb38060bedf396bdbfbf43b4469a7cea049c8338.tar.bz2
gsoc2013-evolution-bb38060bedf396bdbfbf43b4469a7cea049c8338.tar.lz
gsoc2013-evolution-bb38060bedf396bdbfbf43b4469a7cea049c8338.tar.xz
gsoc2013-evolution-bb38060bedf396bdbfbf43b4469a7cea049c8338.tar.zst
gsoc2013-evolution-bb38060bedf396bdbfbf43b4469a7cea049c8338.zip
Fix for bug #63377 and prevention of similar cases.
2004-09-01 Jeffrey Stedfast <fejj@novell.com> Fix for bug #63377 and prevention of similar cases. * em-format.c (emf_finalise): Free the default_charset. (emf_format_clone): Clone the default_charset - this prevents the particular crash described in bug #63377. * em-utils.c (em_utils_message_to_html): If source is NULL, set our own default charset (from the user's gconf key) on the formatter to make sure there's always a source charset for conversion to UTF-8. svn path=/trunk/; revision=27122
-rw-r--r--mail/ChangeLog13
-rw-r--r--mail/em-format.c5
-rw-r--r--mail/em-utils.c12
3 files changed, 29 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 2a5b5f98a6..355a658de7 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,16 @@
+2004-09-01 Jeffrey Stedfast <fejj@novell.com>
+
+ Fix for bug #63377 and prevention of similar cases.
+
+ * em-format.c (emf_finalise): Free the default_charset.
+ (emf_format_clone): Clone the default_charset - this prevents the
+ particular crash described in bug #63377.
+
+ * em-utils.c (em_utils_message_to_html): If source is NULL, set
+ our own default charset (from the user's gconf key) on the
+ formatter to make sure there's always a source charset for
+ conversion to UTF-8.
+
2004-08-30 Jeffrey Stedfast <fejj@novell.com>
* em-folder-tree.c (emft_popup_delete_folder): Set the store and
diff --git a/mail/em-format.c b/mail/em-format.c
index b7598f97c8..c34d66c5a2 100644
--- a/mail/em-format.c
+++ b/mail/em-format.c
@@ -137,6 +137,7 @@ emf_finalise(GObject *o)
em_format_clear_headers(emf);
camel_cipher_validity_free(emf->valid);
g_free(emf->charset);
+ g_free (emf->default_charset);
g_string_free(emf->part_id, TRUE);
/* FIXME: check pending jobs */
@@ -595,7 +596,9 @@ emf_format_clone(EMFormat *emf, CamelFolder *folder, const char *uid, CamelMimeM
emf->mode = emfsource->mode;
g_free(emf->charset);
emf->charset = g_strdup(emfsource->charset);
-
+ g_free (emf->default_charset);
+ emf->default_charset = g_strdup (emfsource->default_charset);
+
em_format_clear_headers(emf);
for (h = (struct _EMFormatHeader *)emfsource->header_list.head; h->next; h = h->next)
em_format_add_header(emf, h->name, h->flags);
diff --git a/mail/em-utils.c b/mail/em-utils.c
index 5a99ded76c..0e341e44c6 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -1458,6 +1458,18 @@ em_utils_message_to_html(CamelMimeMessage *message, const char *credits, guint32
emfq = em_format_quote_new(credits, (CamelStream *)mem, flags);
em_format_set_session((EMFormat *)emfq, session);
+
+ if (!source) {
+ GConfClient *gconf;
+ char *charset;
+
+ gconf = gconf_client_get_default ();
+ charset = gconf_client_get_string (gconf, "/apps/evolution/mail/display/charset", NULL);
+ em_format_set_default_charset ((EMFormat *) emfq, charset);
+ g_object_unref (gconf);
+ g_free (charset);
+ }
+
em_format_format_clone((EMFormat *)emfq, NULL, NULL, message, source);
g_object_unref (emfq);