[Commits] [SCM] claws branch, master, updated. 3.9.3-31-gc8409a4
ticho at claws-mail.org
ticho at claws-mail.org
Fri Mar 7 23:28:25 CET 2014
The branch master of project "claws" (Claws Mail) has been updated
via c8409a47933b566ff93f2805e91980efd7df1c7d (commit)
from d68093c4e5f2777fe13b5d2b6228586900b71dbb (commit)
- Log -----------------------------------------------------------------
commit c8409a47933b566ff93f2805e91980efd7df1c7d
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Fri Mar 7 23:24:39 2014 +0100
When autoselecting account for a new message, handle quoted recipient names better. Patch by Christoph Ruegge, bug #3100.
diff --git a/src/account.c b/src/account.c
index 2d70e6d..a90f370 100644
--- a/src/account.c
+++ b/src/account.c
@@ -1391,23 +1391,24 @@ PrefsAccount *account_get_reply_account(MsgInfo *msginfo, gboolean reply_autosel
int fieldno = 0;
for (field = msginfo->to; fieldno++ < 2; field = msginfo->cc) {
if (!account && field) {
- gchar *to = NULL;
- if (!strchr(field, ',')) {
- Xstrdup_a(to, field, return NULL);
- extract_address(to);
- account = account_find_from_address(to, FALSE);
- } else {
- gchar **split = g_strsplit(field, ",", -1);
- int i = -1;
+ gchar *f = g_strdup(field);
+ if (f) {
+ gchar *cur = f;
+ gchar *next = NULL;
+ gchar *to = NULL;
do {
- i++;
- if (!split[i])
- break;
- Xstrdup_a(to, split[i], return NULL);
+ next = strchr_with_skip_quote(cur, '"', ',');
+ if (next)
+ (*next) = 0;
+ Xstrdup_a(to, cur, return NULL);
extract_address(to);
account = account_find_from_address(to, FALSE);
+ if (next)
+ cur = next + 1;
+ else
+ break;
} while (!account);
- g_strfreev(split);
+ g_free(f);
}
}
}
-----------------------------------------------------------------------
Summary of changes:
src/account.c | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list