[RFC]: Solib search (Was: Re: Cross solib support; continued)
Eli Zaretskii
eliz@is.elta.co.il
Sat Nov 17 12:37:00 GMT 2001
> 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.
More information about the Gdb-patches
mailing list