[gmime/gmime-2-4] Properly terminate the quoted-printable encoding



commit 36eeff4bf8e4e41871cfc7cd2f9090559d9a3fde
Author: Jeffrey Stedfast <fejj gnome org>
Date:   Thu Sep 16 21:56:09 2010 -0400

    Properly terminate the quoted-printable encoding
    
    2010-09-16  Jeffrey Stedfast  <fejj novell com>
    
    	* gmime/gmime-encodings.c (g_mime_encoding_quoted_encode_close):
    	If the last input character is not a \n, append an "=\n"
    sequence.

 ChangeLog               |    5 +++++
 gmime/gmime-encodings.c |    7 ++++++-
 2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d6a9273..b568bf1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-09-16  Jeffrey Stedfast  <fejj novell com>
+
+	* gmime/gmime-encodings.c (g_mime_encoding_quoted_encode_close):
+	If the last input character is not a \n, append an "=\n" sequence.
+
 2010-09-13  Jeffrey Stedfast  <fejj novell com>
 
 	* gmime/gmime-charset.c: Mark known_iconv_charsets[] as
diff --git a/gmime/gmime-encodings.c b/gmime/gmime-encodings.c
index 8acbf6f..b7aca0f 100644
--- a/gmime/gmime-encodings.c
+++ b/gmime/gmime-encodings.c
@@ -902,7 +902,12 @@ g_mime_encoding_quoted_encode_close (const unsigned char *inbuf, size_t inlen, u
 		}
 	}
 	
-	*outptr++ = '\n';
+	if (last != '\n') {
+		/* we end with =\n so that the \n isn't interpreted as a real
+		   \n when it gets decoded later */
+		*outptr++ = '=';
+		*outptr++ = '\n';
+	}
 	
 	*save = 0;
 	*state = -1;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]