Skip to content

Commit

Permalink
fix inf loop.
Browse files Browse the repository at this point in the history
embarrassingly i don't remember how to reproduce this bug.
i fixed it a while ago and didn't have time to write up a
test case.
  • Loading branch information
adsr committed Aug 21, 2021
1 parent 5d84859 commit 3a154dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,14 +718,14 @@ int buffer_get_bline_w_hint(buffer_t *self, bint_t line_index, bline_t *opt_hint
found = fwd;
break;
}
fwd = fwd->next;
fwd = fwd != fwd->next ? fwd->next : NULL;
}
if (rev) {
if (rev->line_index == line_index) {
found = rev;
break;
}
rev = rev->prev;
rev = rev != rev->prev ? rev->prev : NULL;
}
}

Expand Down

0 comments on commit 3a154dd

Please sign in to comment.