diff options
author | Tom Tromey <tom@tromey.com> | 2020-07-01 21:21:12 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-07-01 21:21:12 -0600 |
commit | ea68593bd2c649a73754e150340ba3400c007682 (patch) | |
tree | 6eec9235eaf4eefa022254fb52e47450b9d59b26 /gdb/tui/tui-regs.c | |
parent | 0ac053609a2731bfbb4e164056f2333ab165894e (diff) | |
download | gdb-ea68593bd2c649a73754e150340ba3400c007682.zip gdb-ea68593bd2c649a73754e150340ba3400c007682.tar.gz gdb-ea68593bd2c649a73754e150340ba3400c007682.tar.bz2 |
Use complete_on_enum in tui_reggroup_completer
tui_reggroup_completer has an "XXXX" comment suggesting the use of
complete_on_enum. This patch implements this suggestion.
gdb/ChangeLog
2020-07-01 Tom Tromey <tom@tromey.com>
* tui/tui-regs.c (tui_reggroup_completer): Use complete_on_enum.
Diffstat (limited to 'gdb/tui/tui-regs.c')
-rw-r--r-- | gdb/tui/tui-regs.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c index d33f0aa..b99e299 100644 --- a/gdb/tui/tui-regs.c +++ b/gdb/tui/tui-regs.c @@ -631,18 +631,11 @@ tui_reggroup_completer (struct cmd_list_element *ignore, 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 (); |