From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6787 invoked by alias); 11 Jul 2006 12:47:44 -0000 Received: (qmail 6777 invoked by uid 22791); 11 Jul 2006 12:47:43 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Tue, 11 Jul 2006 12:47:41 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1G0HeN-0004oY-5j; Tue, 11 Jul 2006 08:47:39 -0400 Date: Tue, 11 Jul 2006 12:47:00 -0000 From: Daniel Jacobowitz To: Joel Brobecker Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] New substitute-path commands Message-ID: <20060711124739.GA18324@nevyn.them.org> Mail-Followup-To: Joel Brobecker , gdb-patches@sources.redhat.com References: <20060705215606.GF3580@adacore.com> <20060705230129.GA1145@nevyn.them.org> <20060706044733.GC673@adacore.com> <1152198199.6282.63.camel@dufur.beaverton.ibm.com> <20060706162952.GB24631@nevyn.them.org> <20060707052219.GA971@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060707052219.GA971@adacore.com> User-Agent: Mutt/1.5.11+cvs20060403 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-07/txt/msg00088.txt.bz2 On Thu, Jul 06, 2006 at 10:22:19PM -0700, Joel Brobecker wrote: > +/* If the user specified a source path substitution rule, then > + try applying it on PATH, and return the new path. This new > + path must be deallocated afterwards. > + > + Return NULL if no substitution rule was specified by the user, > + or of this rule didn't apply to the given PATH. */ > + > +static char * > +xrewrite_source_path (const char *path) Why the x? Is it because it allocates? I believe we actually use the x to indicate replacements for system functionality which have a more reliable error behavior; so please don't use it here. > + /* Search for the first occurence of SUBSTITUTE_PATH_FROM. > + No substitution needed of not found. */ If not found. > + from_start = strstr (path, substitute_path_from); This is the part of the patch I'm not sure about. I have two questions. 1. Should the substitution rule be anchored to the beginning of the pathname? 2. Should the end of the rule be anchored to end of string or directory separator? I think #1 should be yes, and #2 should probably be yes, but I'm less certain about it. What do you think? Otherwise the code looks good. -- Daniel Jacobowitz CodeSourcery