Fix mark flattening
This commit is contained in:
parent
52411d0a2e
commit
cdb6f57a47
6
hex.c
6
hex.c
|
@ -462,12 +462,12 @@ app_flatten_marks (void)
|
||||||
closest = MIN (closest, current[i]->offset + current[i]->len);
|
closest = MIN (closest, current[i]->offset + current[i]->len);
|
||||||
|
|
||||||
// Remove from "current" marks that have ended
|
// Remove from "current" marks that have ended
|
||||||
for (size_t i = 0; i < current_len; i++)
|
for (size_t i = 0; i < current_len; )
|
||||||
{
|
|
||||||
if (closest == current[i]->offset + current[i]->len)
|
if (closest == current[i]->offset + current[i]->len)
|
||||||
memmove (current + i, current + i + 1,
|
memmove (current + i, current + i + 1,
|
||||||
(--current_len - i) * sizeof *current);
|
(--current_len - i) * sizeof *current);
|
||||||
}
|
else
|
||||||
|
i++;
|
||||||
|
|
||||||
// Add any new marks at "closest"
|
// Add any new marks at "closest"
|
||||||
while (next < end && next->offset == closest)
|
while (next < end && next->offset == closest)
|
||||||
|
|
Loading…
Reference in New Issue