diff options
Diffstat (limited to 'src/HtmlParser.c')
-rw-r--r-- | src/HtmlParser.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/HtmlParser.c b/src/HtmlParser.c index b4beee4..f300b62 100644 --- a/src/HtmlParser.c +++ b/src/HtmlParser.c @@ -378,6 +378,9 @@ static void html_parser_parse_tag_end(HtmlParser *self) { return; } else if(!tag_name_found && is_identifier_char(c)) { HtmlStringView tag_end_name; + ssize_t found_start_tag_index; + ssize_t i; + tag_end_name.data = self->source + self->offset; html_parser_advance_char(self); for(;;) { @@ -397,8 +400,8 @@ static void html_parser_parse_tag_end(HtmlParser *self) { continue; } - ssize_t found_start_tag_index = -1; - for(ssize_t i = self->unclosed_tags_offset - 1; i >= 0; --i) { + found_start_tag_index = -1; + for(i = self->unclosed_tags_offset - 1; i >= 0; --i) { if(string_view_equals(&self->unclosed_tags[i], &tag_end_name)) { found_start_tag_index = i; break; @@ -422,6 +425,8 @@ static void html_parser_parse_tag_end(HtmlParser *self) { } void html_parser_parse(HtmlParser *self) { + HtmlStringView top_unclosed_tag; + html_parser_reset(self); for(;;) { char c = html_parser_next_char(self); @@ -449,7 +454,6 @@ void html_parser_parse(HtmlParser *self) { } } - HtmlStringView top_unclosed_tag; while(html_parser_try_get_top_unclosed_tag(self, &top_unclosed_tag)) { self->tag_name = top_unclosed_tag; self->parse_callback(self, HTML_PARSE_TAG_END, self->callback_userdata); |