projects
/
claws.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d68093c
)
When autoselecting account for a new message, handle quoted recipient names better...
author
Andrej Kacian
<ticho@claws-mail.org>
Fri, 7 Mar 2014 22:24:39 +0000
(23:24 +0100)
committer
Andrej Kacian
<ticho@claws-mail.org>
Fri, 7 Mar 2014 22:26:15 +0000
(23:26 +0100)
src/account.c
patch
|
blob
|
history
diff --git
a/src/account.c
b/src/account.c
index 2d70e6d7363954ac83ceb73ab174d648453218f9..a90f370b3dbcdf52c0d5152ada573b51dd740401 100644
(file)
--- 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) {
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 {
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);
extract_address(to);
account = account_find_from_address(to, FALSE);
+ if (next)
+ cur = next + 1;
+ else
+ break;
} while (!account);
} while (!account);
- g_
strfreev(split
);
+ g_
free(f
);
}
}
}
}
}
}