- gchar *current, *start, *last_blank;
- gint start_offset = 0, current_offset = 0;
-
- g_return_if_fail (start_indexes != NULL);
- g_return_if_fail (end_indexes != NULL);
-
- start = (gchar *) addresses;
- current = start;
- last_blank = start;
-
- while (*current != '\0') {
- if ((start == current)&&((*current == ' ')||(*current == ',')||(*current == ';'))) {
- start = g_utf8_next_char (start);
- start_offset++;
- last_blank = current;
- } else if ((*current == ',')||(*current == ';')) {
+ GString *str;
+ gchar *start, *cur;
+
+ if (!addresses)
+ return;
+
+ if (strlen (addresses) == 0)
+ return;
+
+ str = g_string_new ("");
+ start = (gchar*) addresses;
+ cur = (gchar*) addresses;
+
+ for (cur = start; *cur != '\0'; cur = g_utf8_next_char (cur)) {
+ if (*cur == ',' || *cur == ';') {