aboutsummaryrefslogtreecommitdiff
path: root/libsylph/html.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2011-08-10 05:48:41 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2011-08-10 05:48:41 +0000
commit0eb22497a036dd0f3ca3828c057c300c7bf9393b (patch)
tree762b3b9f882d1fce3a7aff0deba18ed6ebb8ac46 /libsylph/html.c
parent0d3e6bddbf9a82c4414bf77b84123c6611db6889 (diff)
html.c: style end tags search fix.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2934 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/html.c')
-rw-r--r--libsylph/html.c14
1 files changed, 10 insertions, 4 deletions
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;
}