From 7745ae29860377c3b44b47ed3929b7a881d10fe7 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 22 Feb 2011 09:39:28 +0100 Subject: Bug #434972 - Reply does not detect "RE :" subject prefix --- mail/message-list.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'mail/message-list.c') diff --git a/mail/message-list.c b/mail/message-list.c index 3bc5915f14..8f38fac7bf 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -486,10 +486,19 @@ get_normalised_string (MessageList *message_list, CamelMessageInfo *info, gint c if (col == COL_SUBJECT_NORM) { const guchar *subject; + gboolean found_re = TRUE; subject = (const guchar *) string; - while (!g_ascii_strncasecmp ((gchar *)subject, "Re:", 3)) { - subject += 3; + while (found_re) { + found_re = FALSE; + + if (g_ascii_strncasecmp ((gchar *) subject, "Re:", 3) == 0) { + found_re = TRUE; + subject += 3; + } else if (g_ascii_strncasecmp ((gchar *) subject, "Re :", 4)) { + found_re = TRUE; + subject += 4; + } /* jump over any spaces */ while (*subject && isspace ((gint) *subject)) @@ -1475,10 +1484,20 @@ get_trimmed_subject (CamelMessageInfo *info) } do { + gboolean found_re = TRUE; + found_mlist = FALSE; - while (!g_ascii_strncasecmp ((gchar *) subject, "Re:", 3)) { - subject += 3; + while (found_re) { + found_re = FALSE; + + if (g_ascii_strncasecmp ((gchar *) subject, "Re:", 3) == 0) { + found_re = TRUE; + subject += 3; + } else if (g_ascii_strncasecmp ((gchar *) subject, "Re :", 4) == 0) { + found_re = TRUE; + subject += 4; + } /* jump over any spaces */ while (*subject && isspace ((gint) *subject)) -- cgit v1.2.3