Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Samuel Bronson <naesten@gmail.com>
To: gdb-patches@sourceware.org
Cc: Samuel Bronson <naesten@gmail.com>
Subject: [PATCH 1/2] Fix for PR gdb/9903 (part 1)
Date: Wed, 17 Jun 2009 22:22:00 -0000	[thread overview]
Message-ID: <1245277318-12742-1-git-send-email-naesten@gmail.com> (raw)
In-Reply-To: <m3zlc6wz3q.fsf@fleche.redhat.com>

	* cli/cli-decode.c (apropos_cmd): Fix avoidance of double
	printing.

Signed-off-by: Samuel Bronson <naesten@gmail.com>
---
 gdb/cli/cli-decode.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 4ebf6dc..cd4c984 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -766,10 +766,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*/
@@ -780,7 +781,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)
-- 
1.6.3.1


  parent reply	other threads:[~2009-06-17 22:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-17  3:31 [PATCH 1/2] * cli/cli-decode.c (apropos_cmd): Fix avoidance of double printing Samuel Bronson
2009-06-17  3:31 ` [PATCH 2/2] * cli/cli-decode.c (apropos_cmd): Skip traversing abbreviations for prefix commands to avoid duplicates in the output Samuel Bronson
2009-06-17 17:27   ` Tom Tromey
2009-06-17 17:26 ` [PATCH 1/2] * cli/cli-decode.c (apropos_cmd): Fix avoidance of double printing Tom Tromey
2009-06-17 20:15   ` Samuel Bronson
2009-06-17 22:22   ` Samuel Bronson [this message]
2009-06-17 22:23     ` [PATCH 2/2] Fix for PR gdb/9903 (part 2) Samuel Bronson
2009-06-18 17:59     ` [PATCH 1/2] Fix for PR gdb/9903 (part 1) Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1245277318-12742-1-git-send-email-naesten@gmail.com \
    --to=naesten@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox