This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC]: Solib search (Was: Re: Cross solib support; continued)


> Date: Wed, 28 Nov 2001 18:43:33 +0100
> From: Orjan Friberg <orjan.friberg@axis.com>
> 
> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]