From 6842c8c8a1fc49b1c0f90e1010999da1d4b84f8e Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sat, 29 Jan 2011 15:00:46 +0200 Subject: [PATCH] * mu_str_display_contact_s: split, so 'make cc10' is honored --- src/mu-str.c | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/src/mu-str.c b/src/mu-str.c index 9aeabe9dc..5afcca86f 100644 --- a/src/mu-str.c +++ b/src/mu-str.c @@ -164,6 +164,27 @@ mu_str_summarize (const char* str, size_t max_lines) return summary; } + +static void +cleanup_contact (char *contact) +{ + char *c, *c2; + + /* replace "'<> with space */ + for (c2 = contact; *c2; ++c2) + if (*c2 == '"' || *c2 == '\'' || *c2 == '<' || *c2 == '>') + *c2 = ' '; + + /* remove everything between '()' if it's after the 5th pos; + * good to cleanup corporate contact address spam... */ + c = g_strstr_len (contact, -1, "("); + if (c && c - contact > 5) + *c = '\0'; + + g_strstrip (contact); +} + + /* this is still somewhat simplistic... */ const char* mu_str_display_contact_s (const char *str) @@ -185,22 +206,9 @@ mu_str_display_contact_s (const char *str) * so we can remove the <... part*/ *c = '\0'; } - - /* replace "'<> with space */ - for (c2 = contact; *c2; ++c2) - if (*c2 == '"' || *c2 == '\'' || *c2 == '<' || *c2 == '>') - *c2 = ' '; - - /* FIXME: this breaks cc10 */ - - /* remove everything between '()' if it's after the 5th pos; - * good to cleanup corporate contact address spam... */ - c = g_strstr_len (contact, -1, "("); - if (c && c - contact > 5) - *c = '\0'; - - g_strstrip (contact); + cleanup_contact (contact); + return contact; }