+2020-07-01 Tom Tromey <tom@tromey.com>
+
+ * tui/tui-regs.c (tui_reggroup_completer): Use complete_on_enum.
+
2020-07-01 Fangrui Song <maskray@google.com>
* dwarf2/read.c (lnp_state_machine::check_line_address): Test -1.
completion_tracker &tracker,
const char *text, const char *word)
{
- static const char *extra[] = { "next", "prev", NULL };
- size_t len = strlen (word);
- const char **tmp;
+ static const char * const extra[] = { "next", "prev", NULL };
reggroup_completer (ignore, tracker, text, word);
- /* XXXX use complete_on_enum instead? */
- for (tmp = extra; *tmp != NULL; ++tmp)
- {
- if (strncmp (word, *tmp, len) == 0)
- tracker.add_completion (make_unique_xstrdup (*tmp));
- }
+ complete_on_enum (tracker, extra, text, word);
}
void _initialize_tui_regs ();