memory: fix an off-by-one error to free also the last line in a group
The number of lines in a group is the difference in line numbers
between the last line and the first line *plus one*.
This fixes https://savannah.gnu.org/bugs/?60104.
Bug existed since version 2.9.0, since indenting and unindenting
became undoable, and commit f722c532
formed a part of that.
master
parent
49ca7e5aa8
commit
f6357a73f0
|
@ -951,7 +951,7 @@ void discard_until(const undostruct *thisitem)
|
||||||
while (group != NULL) {
|
while (group != NULL) {
|
||||||
groupstruct *next = group->next;
|
groupstruct *next = group->next;
|
||||||
free_chararray(group->indentations,
|
free_chararray(group->indentations,
|
||||||
group->bottom_line - group->top_line);
|
group->bottom_line - group->top_line + 1);
|
||||||
free(group);
|
free(group);
|
||||||
group = next;
|
group = next;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue