From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14749 invoked by alias); 5 Apr 2002 07:44:47 -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 14734 invoked from network); 5 Apr 2002 07:44:44 -0000 Received: from unknown (HELO frigg.inter.net.il) (192.114.186.16) by sources.redhat.com with SMTP; 5 Apr 2002 07:44:44 -0000 Received: from zaretsky (diup-217-188.inter.net.il [213.8.217.188]) by frigg.inter.net.il (Mirapoint Messaging Server MOS 2.9.3.2) with ESMTP id BHU27916; Fri, 5 Apr 2002 10:44:36 +0300 (IDT) Date: Thu, 04 Apr 2002 23:44:00 -0000 From: "Eli Zaretskii" To: brobecker@ACT-Europe.FR Message-Id: <5567-Fri05Apr2002104019+0300-eliz@is.elta.co.il> CC: gdb-patches@sources.redhat.com In-reply-to: <20020403151909.I26661@act-europe.fr> (message from Joel Brobecker on Wed, 3 Apr 2002 15:19:09 +0200) Subject: Re: [RFC] xfullpath and new regression test xfullpath.exp Reply-to: Eli Zaretskii References: <20020401105021.A13168@act-europe.fr> <20020402172232.C25687@act-europe.fr> <7458-Wed03Apr2002160810+0300-eliz@is.elta.co.il> <20020403151909.I26661@act-europe.fr> X-SW-Source: 2002-04/txt/msg00154.txt.bz2 > Date: Wed, 3 Apr 2002 15:19:09 +0200 > From: Joel Brobecker > > > > if (IS_DIR_SEPARATOR (real_path[strlen (real_path) - 1])) > > > result = concat (real_path, base_name, NULL); > > > else > > > result = concat (real_path, SLASH_STRING, base_name, NULL); > > > > Yes, I think this is better, thanks. > > > > > (can I consider that SLASH_STRING will always be one character long?): > > > > Where does the code assume it's a single character? `concat' conses > > up a new string, right? If so, the length of SLASH_STRING shouldn't > > matter, I think. Or am I missing something? > > I implicitely make this assumption when I use the IS_DIR_SEPARATOR > macro to check the value of the last character in the real_path string, > and then use SLASH_STRING during the concat. You don't need to worry about that: it's IS_DIR_SEPARATOR's job to DTRT for each platform, even if the directory separator is not a single character. > If all is fine, I'll resubmit a new patch shortly. Please do. Thanks.