[Commits] messageview.c 1.94.2.233 1.94.2.234 procmime.c 1.49.2.142 1.49.2.143

miras at claws-mail.org miras at claws-mail.org
Tue Jul 3 19:23:02 CEST 2012


Update of /home/claws-mail/claws/src
In directory srv:/tmp/cvs-serv31901/src

Modified Files:
      Tag: gtk2
	messageview.c procmime.c 
Log Message:
2012-07-03 [mir]	3.8.1cvs2

	* src/messageview.c
	* src/procmime.c
	* src/common/quoted-printable.c
	* src/common/quoted-printable.h
	    Patch fixes bug 2640.
	    Patch provided by madroach claws at gmerlin dot de

Index: messageview.c
===================================================================
RCS file: /home/claws-mail/claws/src/messageview.c,v
retrieving revision 1.94.2.233
retrieving revision 1.94.2.234
diff -u -d -r1.94.2.233 -r1.94.2.234
--- messageview.c	2 Jun 2012 08:57:10 -0000	1.94.2.233
+++ messageview.c	3 Jul 2012 17:23:00 -0000	1.94.2.234
@@ -988,8 +988,9 @@
 		extract_address(orig_to);
 	}
 	if (msginfo->subject && *(msginfo->subject)) {
-		enc_sub = g_malloc0(strlen(msginfo->subject)*8);
-		qp_encode_line(enc_sub, (const guchar *)msginfo->subject);
+		gint len = strlen(msginfo->subject);
+		enc_sub = g_malloc0(len*8);
+		qp_encode(TRUE, enc_sub, (const guchar *)msginfo->subject, len);
 		g_strstrip(enc_sub);
 	}
 	ok = fprintf(fp,"MIME-Version: 1.0\n"

Index: procmime.c
===================================================================
RCS file: /home/claws-mail/claws/src/procmime.c,v
retrieving revision 1.49.2.142
retrieving revision 1.49.2.143
diff -u -d -r1.49.2.142 -r1.49.2.143
--- procmime.c	27 May 2012 17:30:55 -0000	1.49.2.142
+++ procmime.c	3 Jul 2012 17:23:00 -0000	1.49.2.143
@@ -562,16 +562,29 @@
 			g_free(tmp_file);
 		}
 	} else if (encoding == ENC_QUOTED_PRINTABLE) {
-		gchar inbuf[BUFFSIZE], outbuf[BUFFSIZE * 4];
+		gchar inbuf[79], outbuf[77];
+		gint n, len = 0;
+		gboolean firstrun = TRUE;
 
-		while (fgets(inbuf, sizeof(inbuf), infp) != NULL) {
-			qp_encode_line(outbuf, inbuf);
+		while ((len += fread(inbuf + len, 1,
+			sizeof(inbuf) - len - 1,
+			infp)) > 0)
+		{
+			if (firstrun == FALSE)
+				if (fputs("\r\n", outfp) == EOF)
+					err = TRUE;
+
+			inbuf[len] = '\0';
+			n = qp_encode(mimeinfo->type == MIMETYPE_TEXT,
+					outbuf, inbuf, len);
+			len -= n;
+			memmove(inbuf, inbuf + n, len);
 
 			if (!strncmp("From ", outbuf, sizeof("From ")-1)) {
 				gchar *tmpbuf = outbuf;
-				
+
 				tmpbuf += sizeof("From ")-1;
-				
+
 				if (fputs("=46rom ", outfp) == EOF)
 					err = TRUE;
 				if (fputs(tmpbuf, outfp) == EOF)
@@ -580,6 +593,7 @@
 				if (fputs(outbuf, outfp) == EOF)
 					err = TRUE;
 			}
+			firstrun = FALSE;
 		}
 	} else {
 		gchar buf[BUFFSIZE];



More information about the Commits mailing list