Skip to content

Commit

Permalink
Use do {} while in action_del_char
Browse files Browse the repository at this point in the history
  • Loading branch information
jhawthorn committed Sep 23, 2018
1 parent 709bfa0 commit 5cf38d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tty_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ static void action_del_char(tty_interface_t *state) {
}
size_t original_cursor = state->cursor;

state->cursor--;
while (!is_boundary(state->search[state->cursor]) && state->cursor)
do {
state->cursor--;
} while (!is_boundary(state->search[state->cursor]) && state->cursor);

memmove(&state->search[state->cursor], &state->search[original_cursor], length - original_cursor + 1);
}
Expand Down

0 comments on commit 5cf38d6

Please sign in to comment.