From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12916 invoked by alias); 17 Jul 2006 17:09:42 -0000 Received: (qmail 12897 invoked by uid 22791); 17 Jul 2006 17:09:41 -0000 X-Spam-Check-By: sourceware.org Received: from nile.gnat.com (HELO nile.gnat.com) (205.232.38.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 17 Jul 2006 17:09:37 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-nile.gnat.com (Postfix) with ESMTP id 71D5648CBE4; Mon, 17 Jul 2006 13:09:35 -0400 (EDT) Received: from nile.gnat.com ([127.0.0.1]) by localhost (nile.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 27527-01-9; Mon, 17 Jul 2006 13:09:35 -0400 (EDT) Received: from takamaka.act-europe.fr (unknown [70.71.0.212]) by nile.gnat.com (Postfix) with ESMTP id 296F648CEE3; Mon, 17 Jul 2006 13:09:35 -0400 (EDT) Received: by takamaka.act-europe.fr (Postfix, from userid 507) id C239D47EFA; Mon, 17 Jul 2006 10:09:33 -0700 (PDT) Date: Mon, 17 Jul 2006 17:09:00 -0000 From: Joel Brobecker To: Andrew STUBBS Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] set/unset/show substitute-path commands (take 2) Message-ID: <20060717170933.GD1280@adacore.com> References: <20060715054902.GD1393@adacore.com> <44BB586E.7040107@st.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44BB586E.7040107@st.com> User-Agent: Mutt/1.4i 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/msg00206.txt.bz2 > >+ /* Otherwise, skip to the last rule in our list and then append > >+ the new rule. */ > >+ > >+ last = substitute_path_rules; > >+ while (last->next != NULL) > >+ last = last->next; > >+ > >+ last->next = rule; > > What if the user tries to substitute the same path twice? I think it > should delete the old rule (maybe query) and add the new one to the end. I think we are getting dragged into over-engineering this feature. If documentation is clear enough that it just adds, then he knows he has to remove the previous rule before he introduces the new one. That's plenty good enough in my opinion. > >+ /* If no rule matching the argument was found, then print an error > >+ message to the user. */ > >+ > >+ if (!rule_found) > >+ { > >+ if (from != NULL) > >+ error (_("No substitution rule defined for `%s'"), from); > >+ else > >+ error (_("No substitution rule defined")); > > Is the latter case really an error? I would have thought not, since > there's no way for a script to check the status before giving the command. I personally think so, but I don't have a strong opinion on this. The error can be removed if this is the consensus. -- Joel