diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-02-03 22:34:58 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-02-03 22:34:58 +0100 |
commit | cd786ced0f04d9383cde1c451f0bab18135072bd (patch) | |
tree | 12b2c40014bcbb76d8c3251d5beb150d4f45529b /src | |
parent | b5ad3f1202f247ba508cdf6e302ca57fead96439 (diff) |
Make c89 compliant
Diffstat (limited to 'src')
-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); |