aboutsummaryrefslogtreecommitdiff
path: root/libsylph/codeconv.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-01-12 04:51:04 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-01-12 04:51:04 +0000
commite8ea75f1bd6f868a996f799b140ba8b6c8f5ebec (patch)
tree59d2740ff437cff0fc0978e41359f2fd41090abd /libsylph/codeconv.c
parent2b1b7b9a86db5473eafc8c89a6caeeb1e463b22c (diff)
fixed stray quote character appearing after encoding mail headers.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1470 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/codeconv.c')
-rw-r--r--libsylph/codeconv.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/libsylph/codeconv.c b/libsylph/codeconv.c
index 6a16513c..605849d9 100644
--- a/libsylph/codeconv.c
+++ b/libsylph/codeconv.c
@@ -2175,6 +2175,8 @@ void conv_encode_header(gchar *dest, gint len, const gchar *src,
left = MAX_LINELEN - header_len;
while (*srcp) {
+ gboolean in_quote = FALSE;
+
LBREAK_IF_REQUIRED(left <= 0, TRUE);
while (g_ascii_isspace(*srcp)) {
@@ -2219,13 +2221,18 @@ void conv_encode_header(gchar *dest, gint len, const gchar *src,
gboolean cont = FALSE;
while (*p != '\0') {
- if (g_ascii_isspace(*p) &&
- !is_next_nonascii(p + 1))
- break;
- /* don't include parentheses in encoded
- strings */
- if (addr_field && (*p == '(' || *p == ')'))
- break;
+ if (*p == '"')
+ in_quote ^= TRUE;
+ else if (!in_quote) {
+ if (g_ascii_isspace(*p) &&
+ !is_next_nonascii(p + 1))
+ break;
+ /* don't include parentheses in encoded
+ strings */
+ if (addr_field &&
+ (*p == '(' || *p == ')'))
+ break;
+ }
mb_len = g_utf8_skip[*(guchar *)p];