This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC]: Solib search (Was: Re: Cross solib support; continued)
Eli Zaretskii wrote:
>
> This is not how one should test for an absoulte file name portably,
> and incrementing in_pathname by one is not how you portably make it a
> relative file name. I suggest to use IS_ABSOLUTE_PATH for the first
> and this for the second:
>
> while (!IS_DIR_SEPARATOR (*in_pathname++))
> ;
If I understand you correctly, your suggestion is:
if (found_file < 0 && IS_ABSOLUTE_PATH (in_pathname))
{
while (!IS_DIR_SEPARATOR (*in_pathname++))
;
}
That will only get rid of the first dir separator.
To me it seems it should be something like:
if (found_file < 0 && IS_ABSOLUTE_PATH (in_pathname))
{
while (IS_DIR_SEPARATOR (*in_pathname))
in_pathname++;
}
(Can't use while (IS_DIR_SEPARATOR (*in_pathname++)) as it would remove the first
non-dir separator also.)
--
Orjan Friberg
Axis Communications AB