From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9516 invoked by alias); 17 Jun 2009 03:31:01 -0000 Received: (qmail 9502 invoked by uid 22791); 17 Jun 2009 03:30:59 -0000 X-SWARE-Spam-Status: No, hits=-2.3 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 03:30:53 +0000 Received: from mr08.lnh.mail.rcn.net ([207.172.157.28]) by smtp02.lnh.mail.rcn.net with ESMTP; 16 Jun 2009 23:30:51 -0400 Received: from smtp01.lnh.mail.rcn.net (smtp01.lnh.mail.rcn.net [207.172.4.11]) by mr08.lnh.mail.rcn.net (MOS 3.10.5-GA) with ESMTP id KYA64965; Tue, 16 Jun 2009 23:30:15 -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; 16 Jun 2009 23:30:15 -0400 Received: from naesten by hydrogen with local (Exim 4.69) (envelope-from ) id 1MGlqo-0002UZ-4R; Tue, 16 Jun 2009 23:30:14 -0400 From: Samuel Bronson To: gdb-patches@sourceware.org Cc: Samuel Bronson Subject: [PATCH 1/2] * cli/cli-decode.c (apropos_cmd): Fix avoidance of double printing. Date: Wed, 17 Jun 2009 03:31:00 -0000 Message-Id: <1245209405-9539-1-git-send-email-naesten@gmail.com> X-Junkmail-Whitelist: YES (by domain whitelist at mr08.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/msg00429.txt.bz2 Signed-off-by: Samuel Bronson --- gdb/cli/cli-decode.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index 4ebf6dc..e2647fc 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -766,7 +766,7 @@ 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=-1; /*Needed to avoid double printing*/ /* Walk through the commands */ for (c=commandlist;c;c=c->next) { @@ -780,7 +780,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