diff options
author | Jon Trowbridge <trow@ximian.com> | 2001-09-27 03:35:41 +0800 |
---|---|---|
committer | Jon Trowbridge <trow@src.gnome.org> | 2001-09-27 03:35:41 +0800 |
commit | 96ccc526ae2d2eeb91964a537ff7897dda7bb2b5 (patch) | |
tree | 07155f49b3e2a1f4b8e9c8c9ac621963d125c74e /composer | |
parent | 3bf97142fa10290a91deeae010aa08a95b0661d3 (diff) | |
download | gsoc2013-evolution-96ccc526ae2d2eeb91964a537ff7897dda7bb2b5.tar.gz gsoc2013-evolution-96ccc526ae2d2eeb91964a537ff7897dda7bb2b5.tar.zst gsoc2013-evolution-96ccc526ae2d2eeb91964a537ff7897dda7bb2b5.zip |
Fixes glitch in mailto: url parsing that caused it to fail when recipient
2001-09-26 Jon Trowbridge <trow@ximian.com>
* e-msg-composer.c (e_msg_composer_new_from_url): Fixes glitch in
mailto: url parsing that caused it to fail when recipient names
contained commas. (Bug #10796)
svn path=/trunk/; revision=13156
Diffstat (limited to 'composer')
-rw-r--r-- | composer/ChangeLog | 6 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 16 |
2 files changed, 16 insertions, 6 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog index 5447f9676b..81bf1550ef 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,9 @@ +2001-09-26 Jon Trowbridge <trow@ximian.com> + + * e-msg-composer.c (e_msg_composer_new_from_url): Fixes glitch in + mailto: url parsing that caused it to fail when recipient names + contained commas. (Bug #10796) + 2001-09-20 Jeffrey Stedfast <fejj@ximian.com> * e-msg-composer.c (save_draft): Update to reflect changes to diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index fc4ca817ce..61ba59b32b 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -2763,7 +2763,7 @@ add_recipients (GList *list, const char *recips, gboolean decode) * defined by the provided URL. **/ EMsgComposer * -e_msg_composer_new_from_url (const char *url) +e_msg_composer_new_from_url (const char *url_in) { EMsgComposer *composer; EMsgComposerHdrs *hdrs; @@ -2772,20 +2772,24 @@ e_msg_composer_new_from_url (const char *url) char *subject = NULL, *body = NULL; const char *p, *header; int len, clen; - char *content; + char *url, *content; + - g_return_val_if_fail (g_strncasecmp (url, "mailto:", 7) == 0, NULL); + g_return_val_if_fail (g_strncasecmp (url_in, "mailto:", 7) == 0, NULL); composer = e_msg_composer_new (); if (!composer) return NULL; + url = g_strdup (url_in); + camel_url_decode (url); + /* Parse recipients (everything after ':' until '?' or eos. */ p = url + 7; - len = strcspn (p, "?,"); + len = strcspn (p, "?"); if (len) { content = g_strndup (p, len); - to = add_recipients (to, content, TRUE); + to = add_recipients (to, content, FALSE); g_free (content); } @@ -2806,7 +2810,7 @@ e_msg_composer_new_from_url (const char *url) clen = strcspn (p, "&"); content = g_strndup (p, clen); camel_url_decode (content); - + if (!g_strncasecmp (header, "to", len)) to = add_recipients (to, content, FALSE); else if (!g_strncasecmp (header, "cc", len)) |