From 679f56b047225d49eaac96c7f405fb8155e99271 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Tue, 11 Jan 2011 23:22:00 +0200 Subject: [PATCH] * mu-str: minor --- src/mu-str.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mu-str.c b/src/mu-str.c index 5f76ce65..e90f294a 100644 --- a/src/mu-str.c +++ b/src/mu-str.c @@ -171,9 +171,7 @@ mu_str_display_contact_s (const char *str) static gchar contact[255]; gchar *c, *c2; - if (!str) - str = ""; - + str = str ? str : ""; g_strlcpy (contact, str, sizeof(contact)); /* we check for '<', so we can strip out the address stuff in @@ -182,7 +180,6 @@ mu_str_display_contact_s (const char *str) */ c = g_strstr_len (contact, -1, "<"); if (c != NULL) { - for (c2 = contact; c2 < c && !(isalnum(*c2)); ++c2); if (c2 != c) /* apparently, there was something, * so we can remove the <... part*/ @@ -194,6 +191,13 @@ mu_str_display_contact_s (const char *str) if (*c2 == '"' || *c2 == '<' || *c2 == '>') *c2 = ' '; + /* FIXME: this breaks cc10 */ + + /* remove everything between '()' if it's after the 5th pos*/ + /* c = g_strstr_len (contact, -1, "("); */ + /* if (c && c - contact > 5) */ + /* *c = '\0'; */ + g_strstrip (contact); return contact;