aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-11-25 10:41:29 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-11-25 10:41:29 +0000
commitd36950b74ceaa841622df1a885f6d5e20395ff8e (patch)
treed7dcb0876b9e0f9a42dcac8562a9687b81540f86
parent966bdae3e0ff9129ba5832f3e59b302c22371211 (diff)
uncanonicalize unencoded text when saving.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@780 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.ja5
-rw-r--r--libsylph/procmime.c14
3 files changed, 24 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 4ba85787..321989c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2005-11-25
+ * libsylph/procmime.c: procmime_decode_content(): uncanonicalize
+ unencoded text.
+
+2005-11-25
+
* libsylph/pop.c
libsylph/recv.c: don't convert CR+LF to LF.
* libsylph/procmime.c: procmime_decode_content(): don't uncanonicalize
diff --git a/ChangeLog.ja b/ChangeLog.ja
index a14876e2..ad8e5f13 100644
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -1,5 +1,10 @@
2005-11-25
+ * libsylph/procmime.c: procmime_decode_content(): エンコードされて
+ いないテキストを正規化解除するようにした。
+
+2005-11-25
+
* libsylph/pop.c
libsylph/recv.c: CR+LF を LF に変換しないようにした。
* libsylph/procmime.c: procmime_decode_content(): message/rfc822 を
diff --git a/libsylph/procmime.c b/libsylph/procmime.c
index daca09ae..6207807e 100644
--- a/libsylph/procmime.c
+++ b/libsylph/procmime.c
@@ -637,9 +637,23 @@ FILE *procmime_decode_content(FILE *outfp, FILE *infp, MimeInfo *mimeinfo)
flag = TRUE;
}
} else {
+#ifndef G_OS_WIN32
+ gboolean uncanonicalize = FALSE;
+ ContentType content_type;
+
+ content_type = procmime_scan_mime_type(mimeinfo->content_type);
+ if (content_type == MIME_TEXT ||
+ content_type == MIME_TEXT_HTML)
+ uncanonicalize = TRUE;
+#endif
+
while (fgets(buf, sizeof(buf), infp) != NULL &&
(!boundary ||
!IS_BOUNDARY(buf, boundary, boundary_len))) {
+#ifndef G_OS_WIN32
+ if (uncanonicalize)
+ strcrchomp(buf);
+#endif
fputs(buf, outfp);
}
}