aboutsummaryrefslogtreecommitdiff
path: root/libsylph/pop.c
diff options
context:
space:
mode:
Diffstat (limited to 'libsylph/pop.c')
-rw-r--r--libsylph/pop.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libsylph/pop.c b/libsylph/pop.c
index ec703191..b61eb377 100644
--- a/libsylph/pop.c
+++ b/libsylph/pop.c
@@ -549,9 +549,15 @@ static gint pop3_write_msg_to_file(const gchar *file, FILE *src_fp, guint len)
gint len;
len = strlen(buf);
- if (len > 0)
+ if (len > 0) {
last_ch = buf[len - 1];
- else
+ if (last_ch == '\n' && len > 1 &&
+ buf[len - 2] == '\r') {
+ buf[len - 2] = '\n';
+ buf[len - 1] = '\0';
+ } else if (last_ch == '\r')
+ buf[len - 1] = '\0';
+ } else
last_ch = '\0';
if ((last_ch == '\0' || last_ch == '\n') &&