From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19584 invoked by alias); 19 Mar 2002 22:28:04 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 19505 invoked from network); 19 Mar 2002 22:28:02 -0000 Received: from unknown (HELO dublin.ACT-Europe.FR) (212.157.227.154) by sources.redhat.com with SMTP; 19 Mar 2002 22:28:02 -0000 Received: from berlin.ACT-Europe.FR (berlin.int.act-europe.fr [10.10.0.169]) by dublin.ACT-Europe.FR (Postfix) with ESMTP id D2E84229E50; Tue, 19 Mar 2002 23:28:00 +0100 (MET) Received: by berlin.ACT-Europe.FR (Postfix, from userid 507) id 1A04E969; Tue, 19 Mar 2002 23:27:59 +0100 (CET) Date: Tue, 19 Mar 2002 14:28:00 -0000 From: Joel Brobecker To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] gdb_realpath causes problems with GVD Message-ID: <20020319232759.A3188@act-europe.fr> References: <20020319171236.D6465@act-europe.fr> <3C978395.9040306@cygnus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3C978395.9040306@cygnus.com>; from ac131313@cygnus.com on Tue, Mar 19, 2002 at 01:29:41PM -0500 X-SW-Source: 2002-03/txt/msg00367.txt.bz2 > I think gdb_realpath() needs a re-name - it no longer implements > realpath() semantics. xfullpath() comes to mind (`x' for `xmalloc', > `fullpath' cos it is close to realpath :-) (Better ideas? Does libiberty > already provide an equivalent?) I agree. I will wait to make sure everybody agrees to the change, and to see if any other suggestion arises. I'll then perform the name change. > I don't think trying to rewriting the gdb_realpath() autoconfigury magic > is a good idea (the rewrite as two comile errors). Instead just assume > that gdb_realpath() works and use that, concat() and xfree(). Here is how I understand your suggestion: Rewrite gdb_realpath which will always "work", ie return a path. And then implement xfullpath to use it in all cases: char * xfullpath (const char *filename) { const char *base_name = [...]; char *dir_name; char *rp; char *temp_result; char *result; dir_name = [...]; rp = gdb_realpath (dir_name); /* rp will always be non-null */ temp_result = concat (rp, SLASH_CHAR, base_name); result = xstrdup (temp_result); xfree (rp); xfree (temp_result); return result; } -- Joel