From 5d2c29b8d19dc84f75bfa2ce0e2f334f17b5b2e7 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 19 Jun 2009 15:49:35 +0000 Subject: [PATCH] 2009-06-19 Samuel Bronson PR cli/9930: * cli/cli-decode.c (apropos_cmd): Skip traversing abbreviations for prefix commands to avoid duplicates in the output. --- gdb/ChangeLog | 6 ++++++ gdb/cli/cli-decode.c | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b92962e..77777d3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,6 +1,12 @@ 2009-06-19 Samuel Bronson PR cli/9930: + * cli/cli-decode.c (apropos_cmd): Skip traversing abbreviations + for prefix commands to avoid duplicates in the output. + +2009-06-19 Samuel Bronson + + PR cli/9930: * cli/cli-decode.c (apropos_cmd): Fix avoidance of double printing. diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index f8f6f28..3e4f6f5 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -779,8 +779,11 @@ apropos_cmd (struct ui_file *stream, struct cmd_list_element *commandlist, 0 /* don't recurse */, stream); } } - /* Check if this command has subcommands */ - if (c->prefixlist != NULL) + /* Check if this command has subcommands and is not an abbreviation. + We skip listing subcommands of abbreviations in order to avoid + duplicates in the output. + */ + if (c->prefixlist != NULL && !c->abbrev_flag) { /* Recursively call ourselves on the subcommand list, passing the right prefix in. -- 2.7.4