diff options
author | Tom Tromey <tromey@redhat.com> | 2009-06-19 15:47:09 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2009-06-19 15:47:09 +0000 |
commit | 4a98be19cdaffe296173f61b7b1f59f89bf4a382 (patch) | |
tree | 5d2c3ec8d6df346f26dde4de3e4ec8d1f79fcdad | |
parent | 3daf8fe56f9c1c43710fc1b8b9b21fde2a14deae (diff) | |
download | gdb-4a98be19cdaffe296173f61b7b1f59f89bf4a382.zip gdb-4a98be19cdaffe296173f61b7b1f59f89bf4a382.tar.gz gdb-4a98be19cdaffe296173f61b7b1f59f89bf4a382.tar.bz2 |
2009-06-19 Samuel Bronson <naesten@gmail.com>
PR cli/9930:
* cli/cli-decode.c (apropos_cmd): Fix avoidance of double
printing.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/cli/cli-decode.c | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ddaaff4..b92962e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2009-06-19 Samuel Bronson <naesten@gmail.com> + + PR cli/9930: + * cli/cli-decode.c (apropos_cmd): Fix avoidance of double + printing. + 2009-06-19 Jerome Guitton <guitton@adacore.com> * breakpoint.c (expand_line_sal_maybe): When explicit_line, diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index e748ee6..f8f6f28 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -755,10 +755,11 @@ apropos_cmd (struct ui_file *stream, struct cmd_list_element *commandlist, struct re_pattern_buffer *regex, char *prefix) { struct cmd_list_element *c; - int returnvalue=1; /*Needed to avoid double printing*/ + int returnvalue; /* Walk through the commands */ for (c=commandlist;c;c=c->next) { + returnvalue = -1; /*Needed to avoid double printing*/ if (c->name != NULL) { /* Try to match against the name*/ @@ -769,7 +770,7 @@ apropos_cmd (struct ui_file *stream, struct cmd_list_element *commandlist, 0 /* don't recurse */, stream); } } - if (c->doc != NULL && returnvalue != 0) + if (c->doc != NULL && returnvalue < 0) { /* Try to match against documentation */ if (re_search(regex,c->doc,strlen(c->doc),0,strlen(c->doc),NULL) >=0) |