STRBUF: RFC2047-Encode Message - don't ommit linebreaks.
authorWilfried Goesgens <dothebart@citadel.org>
Sat, 7 Dec 2013 16:59:02 +0000 (17:59 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Sat, 7 Dec 2013 16:59:02 +0000 (17:59 +0100)
libcitadel/lib/stringbuf.c

index 9275c26b705274cbcb421ce9fc86a6cd291b808f..90c8cf3525b4c71c5deee20441eb26567a66ac90 100644 (file)
@@ -3043,13 +3043,10 @@ StrBuf *StrBufRFC2047encodeMessage(const StrBuf *EncodeMe)
                }
                else if (*ptr == '\n') {
                        /* hard line break */
-                       if ((LinePos > 0) && (isspace(*(Optr-1))))
-                       {
-                               memcpy(Optr, HKEY("=0A"));
-                               Optr += 3;
-                       }
+                       memcpy(Optr, HKEY("=0A"));
+                       Optr += 3;
+                       LinePos += 3;
                        ptr ++;
-                       LinePos = 0;
                }
                else if (( (*ptr >= 32) && (*ptr <= 60) ) ||
                         ( (*ptr >= 62) && (*ptr <= 126) ))