}
}
-address_t *address_dup(address_t *addr)
+address_t *address_dup(const address_t *addr)
{
address_t *res = address_new();
return res;
}
-address_t *address_list_dup(address_t *addr)
+address_t *address_list_dup(const address_t *addr)
{
address_t *res = NULL, **resp = &res;
s = parse_address(phrase->buf, comment, cur);
if (s && *s && *s != ',' && *s != ';') {
- address_delete(&cur);
+ address_list_wipe(&cur);
return last;
}
stbuf_append_sp(&phrase);
s = next_phrase(s, &phrase);
if (!s) {
- address_delete(&top);
+ address_list_wipe(&top);
return NULL;
}
continue;
stbuf_append_sp(&comment);
s = parse_comment(s + 1, &comment);
if (!s) {
- address_delete(&top);
+ address_list_wipe(&top);
return NULL;
}
continue;
s = parse_address(skipspaces(s + 1), &comment, cur);
if (!s || *s != '>' || !cur->mailbox) {
- address_delete(&top);
- address_delete(&cur);
+ address_list_wipe(&top);
+ address_list_wipe(&cur);
return NULL;
}
return pos;
}
+address_t *mutt_parse_adrlist(address_t *p, const char *s)
+{
+ /* check for a simple whitespace separated list of addresses */
+ char *q = strpbrk(s, "\"<>():;,\\");
+ char tmp[HUGE_STRING];
+
+ if (q)
+ return rfc822_parse_adrlist(p, s);
+
+ m_strcpy(tmp, sizeof(tmp), s);
+ q = tmp;
+ while ((q = strtok(q, " \t"))) {
+ p = rfc822_parse_adrlist(p, q);
+ q = NULL;
+ }
+
+ return p;
+}
+