]> code.citadel.org Git - citadel.git/commitdiff
Merge branch 'stable-78x' of ssh://git.citadel.org/appl/gitroot/citadel into stable-78x
authorWilfried Goesgens <dothebart@citadel.org>
Sat, 20 Aug 2011 12:11:15 +0000 (12:11 +0000)
committerWilfried Goesgens <dothebart@citadel.org>
Sat, 20 Aug 2011 12:11:15 +0000 (12:11 +0000)
libcitadel/lib/stringbuf.c

index 82eb2e670d0e1934cc28ff8246f96e9680854ea5..ebccb9ac4250a6cde3929aa465cdb44d39e34f00 100644 (file)
@@ -2535,6 +2535,8 @@ int StrBufRFC2047encode(StrBuf **target, const StrBuf *source)
                    (ch  > 126) || 
                    (ch ==  61) ||
                    (ch == '=') ||
+                    (ch == '?') ||
+                   (ch == '_') ||
                    (ch == '[') ||
                    (ch == ']')   )
                {
@@ -2542,7 +2544,10 @@ int StrBufRFC2047encode(StrBuf **target, const StrBuf *source)
                        (*target)->BufUsed += 3;
                }
                else {
-                       (*target)->buf[(*target)->BufUsed] = ch;
+                       if (ch == ' ')
+                               (*target)->buf[(*target)->BufUsed] = '_';
+                       else
+                               (*target)->buf[(*target)->BufUsed] = ch;
                        (*target)->BufUsed++;
                }
        }