projects
/
modest
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
882063a
)
* Fixes NB#86176, do not remove own address when it's the only one and "reply to...
author
Sergio Villar Senin
<svillar@igalia.com>
Tue, 3 Jun 2008 15:40:10 +0000
(15:40 +0000)
committer
Sergio Villar Senin
<svillar@igalia.com>
Tue, 3 Jun 2008 15:40:10 +0000
(15:40 +0000)
pmo-trunk-r4601
src/modest-text-utils.c
patch
|
blob
|
history
diff --git
a/src/modest-text-utils.c
b/src/modest-text-utils.c
index
0b8927e
..
012ac59
100644
(file)
--- a/
src/modest-text-utils.c
+++ b/
src/modest-text-utils.c
@@
-356,23
+356,27
@@
modest_text_utils_remove_duplicate_addresses (const gchar *address_list)
{
GSList *addresses, *cursor;
GHashTable *table;
{
GSList *addresses, *cursor;
GHashTable *table;
- gchar *new_list;
+ gchar *new_list = NULL;
g_return_val_if_fail (address_list, NULL);
table = g_hash_table_new (g_str_hash, g_str_equal);
addresses = modest_text_utils_split_addresses_list (address_list);
g_return_val_if_fail (address_list, NULL);
table = g_hash_table_new (g_str_hash, g_str_equal);
addresses = modest_text_utils_split_addresses_list (address_list);
- new_list = g_strdup("");
cursor = addresses;
while (cursor) {
const gchar* address = (const gchar*)cursor->data;
/* ignore the address if already seen */
if (g_hash_table_lookup (table, address) == 0) {
cursor = addresses;
while (cursor) {
const gchar* address = (const gchar*)cursor->data;
/* ignore the address if already seen */
if (g_hash_table_lookup (table, address) == 0) {
-
- gchar *tmp = g_strjoin (",", new_list, address, NULL);
- g_free (new_list);
+ gchar *tmp;
+
+ if (!new_list) {
+ tmp = g_strdup (address);
+ } else {
+ tmp = g_strjoin (",", new_list, address, NULL);
+ g_free (new_list);
+ }
new_list = tmp;
g_hash_table_insert (table, (gchar*)address, GINT_TO_POINTER(1));
new_list = tmp;
g_hash_table_insert (table, (gchar*)address, GINT_TO_POINTER(1));