diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2011-08-10 05:48:41 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2011-08-10 05:48:41 +0000 |
commit | 0eb22497a036dd0f3ca3828c057c300c7bf9393b (patch) | |
tree | 762b3b9f882d1fce3a7aff0deba18ed6ebb8ac46 | |
parent | 0d3e6bddbf9a82c4414bf77b84123c6611db6889 (diff) |
html.c: style end tags search fix.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2934 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | libsylph/html.c | 14 |
2 files changed, 16 insertions, 4 deletions
@@ -1,5 +1,11 @@ 2011-08-10 + * libsylph/html.c: html_get_parenthesis(): fixed a bug that </style> + end tags were not properly searched if whitespace was inserted in it + (ex. </style > </style[\n]>). + +2011-08-10 + * libsylph/procmime.c: removed alloca() calls. 2011-08-03 diff --git a/libsylph/html.c b/libsylph/html.c index e61ea7cf..7799549a 100644 --- a/libsylph/html.c +++ b/libsylph/html.c @@ -621,16 +621,22 @@ static void html_get_parenthesis(HTMLParser *parser, gchar *buf, gint len) } if (!g_ascii_strncasecmp(parser->bufp, "<style", 6)) { parser->bufp += 6; - while ((p = strcasestr(parser->bufp, "</style>")) == NULL) + while ((p = strcasestr(parser->bufp, "</style")) == NULL) if (html_read_line(parser) == HTML_EOF) return; - parser->bufp = p + 8; + parser->bufp = p + 7; + while ((p = strchr(parser->bufp, '>')) == NULL) + if (html_read_line(parser) == HTML_EOF) return; + parser->bufp = p + 1; return; } if (!g_ascii_strncasecmp(parser->bufp, "<script", 7)) { parser->bufp += 7; - while ((p = strcasestr(parser->bufp, "</script>")) == NULL) + while ((p = strcasestr(parser->bufp, "</script")) == NULL) + if (html_read_line(parser) == HTML_EOF) return; + parser->bufp = p + 8; + while ((p = strchr(parser->bufp, '>')) == NULL) if (html_read_line(parser) == HTML_EOF) return; - parser->bufp = p + 9; + parser->bufp = p + 1; return; } |