From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4647 invoked by alias); 17 Jun 2009 22:22:43 -0000 Received: (qmail 4639 invoked by uid 22791); 17 Jun 2009 22:22:42 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_NEUTRAL X-Spam-Check-By: sourceware.org Received: from smtp02.lnh.mail.rcn.net (HELO smtp02.lnh.mail.rcn.net) (207.172.157.102) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 17 Jun 2009 22:22:36 +0000 Received: from mr02.lnh.mail.rcn.net ([207.172.157.22]) by smtp02.lnh.mail.rcn.net with ESMTP; 17 Jun 2009 18:22:33 -0400 Received: from smtp01.lnh.mail.rcn.net (smtp01.lnh.mail.rcn.net [207.172.4.11]) by mr02.lnh.mail.rcn.net (MOS 3.10.5-GA) with ESMTP id PZC89058; Wed, 17 Jun 2009 18:22:32 -0400 (EDT) Received: from 207-172-203-39.c3-0.upd-ubr7.trpr-upd.pa.cable.rcn.com (HELO hydrogen) ([207.172.203.39]) by smtp01.lnh.mail.rcn.net with ESMTP; 17 Jun 2009 18:22:32 -0400 Received: from naesten by hydrogen with local (Exim 4.69) (envelope-from ) id 1MH3WZ-0003Ke-H5; Wed, 17 Jun 2009 18:22:31 -0400 From: Samuel Bronson To: gdb-patches@sourceware.org Cc: Samuel Bronson Subject: [PATCH 1/2] Fix for PR gdb/9903 (part 1) Date: Wed, 17 Jun 2009 22:22:00 -0000 Message-Id: <1245277318-12742-1-git-send-email-naesten@gmail.com> In-Reply-To: References: X-Junkmail-Whitelist: YES (by domain whitelist at mr02.lnh.mail.rcn.net) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-06/txt/msg00455.txt.bz2 * cli/cli-decode.c (apropos_cmd): Fix avoidance of double printing. Signed-off-by: Samuel Bronson --- 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