Skip to content

Commit

Permalink
* mu_str_display_contact_s: split, so 'make cc10' is honored
Browse files Browse the repository at this point in the history
  • Loading branch information
djcb committed Jan 29, 2011
1 parent ea544a9 commit 6842c8c
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions src/mu-str.c
Expand Up @@ -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)
Expand All @@ -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;
}

Expand Down

0 comments on commit 6842c8c

Please sign in to comment.