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) {
store_prefixes(line_begin);
for (auto cur = line_begin; it != cur - 1;
cur = (*cur).ws_only() ? tokens.erase(cur) : cur + 1)
it = (*cur).eol() ? cur - 1 : it;
auto c = line_begin;
for (bool end = false; !end; c = (*c).ws_only() ? tokens.erase(c) : ++c)
if ((end = (*c).eol()))
it = c - 1;
}
non_space = has_tag = false;