]> code.citadel.org Git - citadel.git/blobdiff - webcit/msg_renderers.c
Performed a bunch of markup fixes suggested by validator.w3.org
[citadel.git] / webcit / msg_renderers.c
index a58f64043a5dbb6aff7e6e5e56568c788fc6f0ed..87931500e44ec54f403ebbbd763f8dbb56c82d70 100644 (file)
@@ -1032,7 +1032,7 @@ void render_MAIL_text_plain(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *F
                        if (i > 0) StrBufCutLeft(Line, i);
                
                        if (StrLength(Line) == 0) {
-                               StrBufAppendBufPlain(Target, HKEY("<tt></tt><br />\n"), 0);
+                               StrBufAppendBufPlain(Target, HKEY("<tt></tt><br>\n"), 0);
                                continue;
                        }
 
@@ -1049,7 +1049,7 @@ void render_MAIL_text_plain(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *F
                        UrlizeText(Line1, Line, Line2);
 
                        StrEscAppend(Target, Line1, NULL, 0, 0);
-                       StrBufAppendBufPlain(Target, HKEY("</tt><br />\n"), 0);
+                       StrBufAppendBufPlain(Target, HKEY("</tt><br>\n"), 0);
                        bn = bq;
                }
        while ((BufPtr != StrBufNOTNULL) &&
@@ -1058,7 +1058,7 @@ void render_MAIL_text_plain(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *F
        for (i = 0; i < bn; i++)                                
                StrBufAppendBufPlain(Target, HKEY("</blockquote>"), 0);
 
-       StrBufAppendBufPlain(Target, HKEY("</i><br />"), 0);
+       StrBufAppendBufPlain(Target, HKEY("</i><br>"), 0);
 #ifdef HAVE_ICONV
        if (ic != (iconv_t)(-1) ) {
                iconv_close(ic);
@@ -1100,7 +1100,7 @@ void render_MAIL_UNKNOWN(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *Foun
        FlushStrBuf(Mime->Data);
        StrBufAppendBufPlain(Mime->Data, _("I don't know how to display "), -1, 0);
        StrBufAppendBuf(Mime->Data, Mime->ContentType, 0);
-       StrBufAppendBufPlain(Mime->Data, HKEY("<br />\n"), 0);
+       StrBufAppendBufPlain(Mime->Data, HKEY("<br>\n"), 0);
 }
 
 
@@ -1275,12 +1275,15 @@ int ParseMessageListHeaders_Detail(StrBuf *Line,
                                   StrBuf *ConversionBuffer)
 {
        wcsession *WCC = WC;
+       long len;
+       long totallen;
 
        CheckConvertBufs(WCC);
 
-       Msg->from = NewStrBufPlain(NULL, StrLength(Line));
-       StrBufExtract_NextToken(ConversionBuffer, Line, pos, '|');
-       if (StrLength(ConversionBuffer) != 0) {
+       totallen = StrLength(Line);
+       Msg->from = NewStrBufPlain(NULL, totallen);
+       len = StrBufExtract_NextToken(ConversionBuffer, Line, pos, '|');
+       if (len > 0) {
                /* Handle senders with RFC2047 encoding */
                StrBuf_RFC822_2_Utf8(Msg->from, 
                                     ConversionBuffer, 
@@ -1291,9 +1294,9 @@ int ParseMessageListHeaders_Detail(StrBuf *Line,
        }
                        
        /* node name */
-       StrBufExtract_NextToken(ConversionBuffer, Line, pos, '|');
-       if ((StrLength(ConversionBuffer) !=0 ) &&
-                   ( ((WCC->CurRoom.QRFlags & QR_NETWORK)
+       len = StrBufExtract_NextToken(ConversionBuffer, Line, pos, '|');
+       if ((len > 0 ) &&
+           ( ((WCC->CurRoom.QRFlags & QR_NETWORK)
               || ((strcasecmp(ChrPtr(ConversionBuffer), ChrPtr(WCC->serv_info->serv_nodename))
                    && (strcasecmp(ChrPtr(ConversionBuffer), ChrPtr(WCC->serv_info->serv_fqdn))))))))
        {
@@ -1305,7 +1308,7 @@ int ParseMessageListHeaders_Detail(StrBuf *Line,
         *      StrBufExtract_token(Msg->inetaddr, Line, 4, '|');
         */
        StrBufSkip_NTokenS(Line, pos, '|', 1);
-       Msg->subj = NewStrBufPlain(NULL, StrLength(Line));
+       Msg->subj = NewStrBufPlain(NULL, totallen);
 
        FlushStrBuf(ConversionBuffer);
        /* we assume the subject is the last parameter inside of the list; 
@@ -1313,17 +1316,17 @@ int ParseMessageListHeaders_Detail(StrBuf *Line,
         * on tokenizer chars inside of the subjects
        StrBufExtract_NextToken(ConversionBuffer,  Line, pos, '|');
        */
+       len = 0;
        if (*pos != StrBufNOTNULL) {
-               StrBufPlain(ConversionBuffer, *pos, 
-                           StrLength(Line) - (*pos - ChrPtr(Line)));
+               len = totallen - (*pos - ChrPtr(Line));
+               StrBufPlain(ConversionBuffer, *pos, len);
                *pos = StrBufNOTNULL;
-               if ((StrLength(ConversionBuffer) > 0) &&
-                   (*(ChrPtr(ConversionBuffer) + 
-                      StrLength(ConversionBuffer) - 1) == '|'))
+               if ((len > 0) &&
+                   (*(ChrPtr(ConversionBuffer) + len - 1) == '|'))
                        StrBufCutRight(ConversionBuffer, 1);
        }
 
-       if (StrLength(ConversionBuffer) == 0)
+       if (len == 0)
                StrBufAppendBufPlain(Msg->subj, _("(no subject)"), -1,0);
        else {
                StrBuf_RFC822_2_Utf8(Msg->subj,