From 115c8ef7a383b0b4be866192287301f56df540d2 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 5 Nov 2001 19:47:59 +0000 Subject: Renamed from mail_html_write_string. 2001-11-01 Jeffrey Stedfast * mail-display.h (mail_html_write): Renamed from mail_html_write_string. * mail-display.c (mail_text_write): Don't bother with varargs since nothing used them, we were only passing strings anyway... (mail_error_printf): Renamed from mail_error_write, this makes more sense. (mail_html_write): Removed. * mail-format.c: Updated to use gtk_html_stream_printf directly and s/mail_html_write_string/mail_html_write. (mail_lookup_handler): Don't use %.*s here either... (handle_text_enriched): Same. (write_one_text_plain_chunk): And finally here (also update for new mail_text_write api). (handle_multipart_signed): Update for new mail_text_write api. (format_mime_part): Update for new mail_error_text/printf name change. (handle_multipart_encrypted): Same. * mail-tools.c (mail_tool_generate_forward_subject): Same as mail_generate_reply. * mail-callbacks.c (mail_generate_reply): Don't use %.*s in any *printf* functions. svn path=/trunk/; revision=14590 --- mail/mail-tools.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'mail/mail-tools.c') diff --git a/mail/mail-tools.c b/mail/mail-tools.c index e6098a8979..f403514c66 100644 --- a/mail/mail-tools.c +++ b/mail/mail-tools.c @@ -161,10 +161,17 @@ mail_tool_generate_forward_subject (CamelMimeMessage *msg) if (subject && *subject) { /* Truncate insanely long subjects */ - if (strlen (subject) < max_subject_length) + if (strlen (subject) < max_subject_length) { fwd_subj = g_strdup_printf ("[Fwd: %s]", subject); - else - fwd_subj = g_strdup_printf ("[Fwd: %.*s...]", max_subject_length, subject); + } else { + /* We can't use %.*s because it depends on the locale being C/POSIX + or UTF-8 to work correctly in glibc */ + /*fwd_subj = g_strdup_printf ("[Fwd: %.*s...]", max_subject_length, subject);*/ + fwd_subj = g_malloc (max_subject_length + 11); + memcpy (fwd_subj, "[Fwd: ", 6); + memcpy (fwd_subj + 6, subject, max_subject_length); + memcpy (fwd_subj + 6 + max_subject_length, "...]", 5); + } } else { const CamelInternetAddress *from; char *fromstr; -- cgit v1.2.3