fix bug 3561, 'HTML <a> tag with no href makes message display incorrectly.'
authorPaul <paul@claws-mail.org>
Tue, 10 Nov 2015 15:20:23 +0000 (15:20 +0000)
committerPaul <paul@claws-mail.org>
Tue, 10 Nov 2015 15:20:23 +0000 (15:20 +0000)
based on patch by Andy Balaam

AUTHORS
src/gtk/authors.h
src/html.c

diff --git a/AUTHORS b/AUTHORS
index b75f349b9b6bac91c43e710ef3a32f8118e3940a..12ed96abd3a1892824da48cd9a94ed6e78b94867 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -307,3 +307,4 @@ contributors (in addition to the above; based on Changelog)
        Mikhail Kurinnoi
        Arthur Huillet
        Blatinox
+       Andy Balaam
index 46517058e912e30875df34faa027ee2e5830c581..d4aa975e3a20a064ae94dd5d272f9ae5cea88e8f 100644 (file)
@@ -86,11 +86,12 @@ static char *CONTRIBS_LIST[] = {
 "André Filipe de Assunção e Brito",
 "Sergei Astanin",
 "Ruslan N. Balkin",
+"Andy Balaam",
 "Henri Bauer",
+"Didier Barvaux",
 "Fabio Júnior Beneditto",
 "M. Benkmann",
 "Wilbert Berendsen",
-"Didier Barvaux",
 "Sébastien Bigaret",
 "Laurent Bigonville",
 "Jean-Luc Biord",
index 19cb52c843ff64ed81d4a04ebc5ac5fcd9a5e199..72df9464449d52e5b86311c9577f96a66d6d4066 100644 (file)
@@ -649,6 +649,7 @@ static SC_HTMLState sc_html_parse_tag(SC_HTMLParser *parser)
                parser->state = SC_HTML_BR;
        } else if (!strcmp(tag->name, "a")) {
                GList *cur;
+               parser->href = NULL;
                for (cur = tag->attr; cur != NULL; cur = cur->next) {
                        if (cur->data && !strcmp(((SC_HTMLAttr *)cur->data)->name, "href")) {
                                g_free(parser->href);
@@ -658,6 +659,8 @@ static SC_HTMLState sc_html_parse_tag(SC_HTMLParser *parser)
                                break;
                        }
                }
+               if (parser->href == NULL)
+                       parser->href = g_strdup("");
                parser->state = SC_HTML_HREF_BEG;
        } else if (!strcmp(tag->name, "/a")) {
                parser->state = SC_HTML_HREF;