Convert newlines in the message text to the canonical form
authorSergey Vlasov <vsu@users.sourceforge.net>
Tue, 1 Oct 2002 14:47:37 +0000 (14:47 +0000)
committerSergey Vlasov <vsu@users.sourceforge.net>
Tue, 1 Oct 2002 14:47:37 +0000 (14:47 +0000)
before base64 encoding (RFC2045 compliance, fixes some
interoperability issues with Evolution 1.0.3)

ChangeLog.claws
configure.in
src/compose.c

index c8120ad27cb9685108e5d5eedeaa2d7a38883a3a..a4d79f8da32d836e71e4f21ef910e255feded1e5 100644 (file)
@@ -1,3 +1,10 @@
+2002-10-01 [sergey]    0.8.3claws40
+
+       * src/compose.c
+               Convert newlines in the message text to the canonical form
+               before base64 encoding (RFC2045 compliance, fixes some
+               interoperability issues with Evolution 1.0.3)
+
 2002-09-29 [colin]     0.8.3claws39
 
        * src/summaryview.c
index 92c0bbbe09cd1248599f13aa1014265e0514d936..a1e85275db37a5f92e03812eedd72c34bd2f0cda 100644 (file)
@@ -10,7 +10,7 @@ MINOR_VERSION=8
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws39
+EXTRA_VERSION=claws40
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 649e538a04feebf7a305e0d73fdd9f606de04209..fe3dcece6fb82ffcd216d96a6628780c42a0aa8f 100644 (file)
@@ -3295,6 +3295,34 @@ static gint compose_write_to_file(Compose *compose, const gchar *file,
        }
        g_free(chars);
 
+       /* Canonicalize line endings in the message text */
+       {
+               gchar *canon_buf, *out;
+               const gchar *p;
+               guint new_len = 0;
+
+               for (p = buf ; *p; ++p) {
+                       if (*p != '\r') {
+                               ++new_len;
+                               if (*p == '\n')
+                                       ++new_len;
+                       }
+               }
+
+               out = canon_buf = g_new(gchar, new_len + 1);
+               for (p = buf; *p; ++p) {
+                       if (*p != '\r') {
+                               if (*p == '\n')
+                                       *out++ = '\r';
+                               *out++ = *p;
+                       }
+               }
+               *out = '\0';
+
+               free(buf);
+               buf = canon_buf;
+       }
+
 #if USE_GPGME
        if (!is_draft && compose->use_signing && compose->account->clearsign) {
                if (compose_clearsign_text(compose, &buf) < 0) {