projects
/
modest
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* modest-text-utils.[ch]:
[modest]
/
src
/
modest-text-utils.c
diff --git
a/src/modest-text-utils.c
b/src/modest-text-utils.c
index
130bc8f
..
5cf47bc
100644
(file)
--- a/
src/modest-text-utils.c
+++ b/
src/modest-text-utils.c
@@
-213,16
+213,18
@@
modest_text_utils_derived_subject (const gchar *subject, const gchar *prefix)
}
}
}
}
-gchar *
+gchar*
modest_text_utils_remove_address (const gchar *address_list, const gchar *address)
{
modest_text_utils_remove_address (const gchar *address_list, const gchar *address)
{
- char *dup, *token, *ptr, *result;
+ gchar *dup, *token, *ptr, *result;
GString *filtered_emails;
GString *filtered_emails;
- if (!address_list)
- return NULL;
+ g_return_val_if_fail (address_list, NULL);
- /* Search for substring */
+ if (!address)
+ return g_strdup (address_list);
+
+ /* search for substring */
if (!strstr ((const char *) address_list, (const char *) address))
return g_strdup (address_list);
if (!strstr ((const char *) address_list, (const char *) address))
return g_strdup (address_list);
@@
-235,9
+237,9
@@
modest_text_utils_remove_address (const gchar *address_list, const gchar *addres
/* Add to list if not found */
if (!strstr ((const char *) token, (const char *) address)) {
if (filtered_emails->len == 0)
/* Add to list if not found */
if (!strstr ((const char *) token, (const char *) address)) {
if (filtered_emails->len == 0)
- g_string_append_printf (filtered_emails, "%s", token);
+ g_string_append_printf (filtered_emails, "%s", g_strstrip (token));
else
else
- g_string_append_printf (filtered_emails, ",%s", token);
+ g_string_append_printf (filtered_emails, ",%s", g_strstrip (token));
}
token = strtok_r (NULL, ",", &ptr);
}
}
token = strtok_r (NULL, ",", &ptr);
}