invalid iterator bug fix

This commit is contained in:
Daniel Sipka 2015-10-02 13:08:46 +02:00
parent 9e7be880d7
commit fc59284ee7

View file

@ -76,9 +76,10 @@ void template_type::strip_whitespace() {
if (has_tag && !non_space) { if (has_tag && !non_space) {
store_prefixes(line_begin); store_prefixes(line_begin);
for (auto cur = line_begin; it != cur - 1; auto c = line_begin;
cur = (*cur).ws_only() ? tokens.erase(cur) : cur + 1) for (bool end = false; !end; c = (*c).ws_only() ? tokens.erase(c) : ++c)
it = (*cur).eol() ? cur - 1 : it; if ((end = (*c).eol()))
it = c - 1;
} }
non_space = has_tag = false; non_space = has_tag = false;