* ParseMessageListHeaders_Detail(): don't use the tokenizer to read the subject;...
authorWilfried Göesgens <willi@citadel.org>
Wed, 21 Apr 2010 22:42:11 +0000 (22:42 +0000)
committerWilfried Göesgens <willi@citadel.org>
Wed, 21 Apr 2010 22:42:11 +0000 (22:42 +0000)
webcit/msg_renderers.c

index 03b8191525a59ec1cad975e9328525a2d3d4f31b..d3a7c423f2b86bef184cee2fb329365607b8ce79 100644 (file)
@@ -1208,7 +1208,23 @@ int ParseMessageListHeaders_Detail(StrBuf *Line,
         */
        StrBufSkip_NTokenS(Line, pos, '|', 1);
        Msg->subj = NewStrBufPlain(NULL, StrLength(Line));
+
+       FlushStrBuf(ConversionBuffer);
+       /* we assume the subject is the last parameter inside of the list; 
+        * thus we don't use the tokenizer to fetch it, since it will hick up 
+        * on tokenizer chars inside of the subjects
        StrBufExtract_NextToken(ConversionBuffer,  Line, pos, '|');
+       */
+       if (*pos != StrBufNOTNULL) {
+               StrBufPlain(ConversionBuffer, *pos, 
+                           StrLength(Line) - (*pos - ChrPtr(Line)));
+               *pos = StrBufNOTNULL;
+               if ((StrLength(ConversionBuffer) > 0) &&
+                   (*(ChrPtr(ConversionBuffer) + 
+                      StrLength(ConversionBuffer) - 1) == '|'))
+                       StrBufCutRight(ConversionBuffer, 1);
+       }
+
        if (StrLength(ConversionBuffer) == 0)
                StrBufAppendBufPlain(Msg->subj, _("(no subject)"), -1,0);
        else {