Fixed the handling of HTML messages when the character set is
authorArt Cancro <ajc@citadel.org>
Sat, 4 Feb 2006 18:11:06 +0000 (18:11 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 4 Feb 2006 18:11:06 +0000 (18:11 +0000)
declared in an HTML meta tag instead of in the MIME headers.
Nearly all of these messages should parse now.

webcit/html2html.c

index 31531f3a01c1b0767ea13c1ec24178c38ecb04d9..1f2d358c93b75987e4aa06d49136621fa0af2227 100644 (file)
@@ -249,7 +249,9 @@ void output_html(char *supplied_charset, int treat_as_wiki) {
        converted_msg = malloc(content_length);
        strcpy(converted_msg, "");
        ptr = msg;
+       msgend = strchr(msg, 0);
        while (ptr < msgend) {
+
                /**
                 * Change mailto: links to WebCit mail, by replacing the
                 * link with one that points back to our mail room.  Due to
@@ -280,7 +282,6 @@ void output_html(char *supplied_charset, int treat_as_wiki) {
                                ptr = &ptr[8];
                        }
                        else if ( (treat_as_wiki) && (strncasecmp(ptr, "<a href=\"wiki?", 14)) ) {
-                               lprintf(9, "converting wiki link\n");
                                content_length += 64;
                                converted_msg = realloc(converted_msg, content_length);
                                sprintf(&converted_msg[output_length], "<a href=\"wiki?page=");