|
...
|
...
|
@@ -166,7 +166,10 @@ static void action_pagedown(tty_interface_t *state) {
|
|
166
|
166
|
|
|
167
|
167
|
static void action_autocomplete(tty_interface_t *state) {
|
|
168
|
168
|
update_state(state);
|
|
169
|
|
- strncpy(state->search, choices_get(state->choices, state->choices->selection), SEARCH_SIZE_MAX);
|
|
|
169
|
+ const char *current_selection = choices_get(state->choices, state->choices->selection);
|
|
|
170
|
+ if (current_selection) {
|
|
|
171
|
+ strncpy(state->search, choices_get(state->choices, state->choices->selection), SEARCH_SIZE_MAX);
|
|
|
172
|
+ }
|
|
170
|
173
|
}
|
|
171
|
174
|
|
|
172
|
175
|
static void action_exit(tty_interface_t *state) {
|