From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6797 invoked by alias); 28 Nov 2001 18:05:14 -0000 Mailing-List: contact gdb-patches-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 6774 invoked from network); 28 Nov 2001 18:05:11 -0000 Received: from unknown (HELO mirapoint.inter.net.il) (192.114.186.20) by hostedprojects.ges.redhat.com with SMTP; 28 Nov 2001 18:05:11 -0000 Received: from zaretsky ([192.116.55.139]) by mirapoint.inter.net.il (Mirapoint) with ESMTP id BBB53068; Wed, 28 Nov 2001 20:04:52 +0200 (IST) Date: Sat, 17 Nov 2001 12:37:00 -0000 From: "Eli Zaretskii" To: orjan.friberg@axis.com Message-Id: <2950-Wed28Nov2001200425+0200-eliz@is.elta.co.il> X-Mailer: emacs 21.1.50 (via feedmail 8 I) and Blat ver 1.8.9 CC: gdb-patches@sources.redhat.com In-reply-to: <3C052245.8C02668E@axis.com> (message from Orjan Friberg on Wed, 28 Nov 2001 18:43:33 +0100) Subject: Re: [RFC]: Solib search (Was: Re: Cross solib support; continued) Reply-to: Eli Zaretskii References: <3BEAA3A0.586B3046@axis.com> <20011108110955.A12240@nevyn.them.org> <3C03AB51.DB27B3D4@axis.com> <3405-Tue27Nov2001175932+0200-eliz@is.elta.co.il> <3C04B5A9.1F054A9F@axis.com> <7458-Wed28Nov2001183554+0200-eliz@is.elta.co.il> <3C052245.8C02668E@axis.com> X-SW-Source: 2001-11/txt/msg00323.txt.bz2 > Date: Wed, 28 Nov 2001 18:43:33 +0100 > From: Orjan Friberg > > I was trying to address the situation where in_pathname contains several > leading slashes; then your suggested code (and my original code also) > would terminate too early. I guess we don't normally care about > multiple leading slashes since it's a valid path, but in this case we > need to get rid of all of them to make it a relative path. > > This code should cut it: > > if (found_file < 0 && IS_ABSOLUTE_PATH (in_pathname)) > { > /* First, get rid of any drive letters etc. */ > while (!IS_DIR_SEPARATOR (*in_pathname)) > in_pathname++; > > /* Next, get rid of all leading dir separators. */ > while (IS_DIR_SEPARATOR (*in_pathname)) > in_pathname++; > } Yes, this does what you want, AFAICS. Thanks for explaining the issue.