From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5419 invoked by alias); 2 Jun 2014 15:14:29 -0000 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 Received: (qmail 5407 invoked by uid 89); 2 Jun 2014 15:14:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 02 Jun 2014 15:14:28 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 4C6C41161E7; Mon, 2 Jun 2014 11:14:26 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id dE3o+e2n4HZt; Mon, 2 Jun 2014 11:14:26 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 17DC01161C8; Mon, 2 Jun 2014 11:14:26 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id AE96540E72; Mon, 2 Jun 2014 08:14:26 -0700 (PDT) Date: Mon, 02 Jun 2014 15:14:00 -0000 From: Joel Brobecker To: Brad Mouring Cc: gdb-patches@sourceware.org, Brad Mouring Subject: Re: [PATCH 2/2] gdb/source.c: Fix matching path substitute rule listing Message-ID: <20140602151426.GI4289@adacore.com> References: <20140528161531.GA4289@adacore.com> <1401316902-12320-1-git-send-email-brad.mouring@ni.com> <1401316902-12320-3-git-send-email-brad.mouring@ni.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1401316902-12320-3-git-send-email-brad.mouring@ni.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-06/txt/msg00020.txt.bz2 Brad, I would merge both patches into one, in this case, as I suspect this will simplify submission for you. Make sure to always include the ChangeLog entry in your revision log for every patch. The introduction email (aka cover letter) explains very well what you are trying to do, and I would use that as your revision log for the merged patch. > diff --git a/gdb/source.c b/gdb/source.c > index c77a4f4..a32872f 100644 > --- a/gdb/source.c > +++ b/gdb/source.c > @@ -1875,6 +1875,7 @@ show_substitute_path_command (char *args, int from_tty) > char **argv; > char *from = NULL; > struct cleanup *cleanup; > + int rule_from_len; > > argv = gdb_buildargv (args); > cleanup = make_cleanup_freeargv (argv); > @@ -1897,7 +1898,11 @@ show_substitute_path_command (char *args, int from_tty) > > while (rule != NULL) > { > - if (from == NULL || FILENAME_CMP (rule->from, from) == 0) > + rule_from_len = strlen(rule->from); > + if (from == NULL || > + ((filename_ncmp (rule->from, from, rule_from_len) == 0) && > + (IS_DIR_SEPARATOR (from[rule_from_len]) || > + from[rule_from_len] == 0))) Why not use substitute_path_rule_matches, here? -- Joel