aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog5
-rw-r--r--mail/mail-tools.c25
2 files changed, 22 insertions, 8 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index c742349f96..16307a3e04 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,10 @@
2001-05-08 Jeffrey Stedfast <fejj@ximian.com>
+ * mail-tools.c (mail_tool_forward_message): Convert the Subject
+ header to HTML and also make sure that the Subject, To, and From
+ header values are non-NULL before feeding them into
+ e_text_to_html().
+
* mail-callbacks.c (edit_msg_internal): Free the UIDs if the user
decides to not go through with editing all the messages he
selected.
diff --git a/mail/mail-tools.c b/mail/mail-tools.c
index 97433457a0..994879953b 100644
--- a/mail/mail-tools.c
+++ b/mail/mail-tools.c
@@ -396,27 +396,36 @@ mail_tool_forward_message (CamelMimeMessage *message)
if (text) {
gchar *ret_text, *credits = NULL;
const CamelInternetAddress *cia;
- const char *subject;
- char *buf, *from, *to;
+ char *buf, *from, *to, *subject;
/* create credits */
cia = camel_mime_message_get_from (message);
buf = camel_address_format (CAMEL_ADDRESS (cia));
- from = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL | E_TEXT_TO_HTML_CONVERT_URLS);
- g_free (buf);
+ if (buf) {
+ from = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL | E_TEXT_TO_HTML_CONVERT_URLS);
+ g_free (buf);
+ } else
+ from = NULL;
cia = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO);
buf = camel_address_format (CAMEL_ADDRESS (cia));
- to = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL | E_TEXT_TO_HTML_CONVERT_URLS);
- g_free (buf);
+ if (buf) {
+ to = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL | E_TEXT_TO_HTML_CONVERT_URLS);
+ g_free (buf);
+ } else
+ to = NULL;
- subject = camel_mime_message_get_subject (message);
+ buf = (char *) camel_mime_message_get_subject (message);
+ if (buf)
+ subject = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL | E_TEXT_TO_HTML_CONVERT_URLS);
+ else
+ subject = "";
credits = g_strdup_printf (_("-----Forwarded Message-----<br>"
"<b>From:</b> %s<br>"
"<b>To:</b> %s<br>"
"<b>Subject:</b> %s<br>"),
- from, to, subject);
+ from ? from : "", to ? to : "", subject);
g_free (from);
g_free (to);