This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 2/4] Add a new function child_path.
- From: Simon Marchi <simark at simark dot ca>
- To: John Baldwin <jhb at FreeBSD dot org>, gdb-patches at sourceware dot org
- Date: Mon, 11 Feb 2019 21:46:15 -0500
- Subject: Re: [PATCH v2 2/4] Add a new function child_path.
- References: <cover.1548707934.git.jhb@FreeBSD.org> <a8e20bfd95d5f01e5328edc9ea1748dc06afb129.1548707934.git.jhb@FreeBSD.org> <b88f9823-caee-cb57-835f-81297f481188@simark.ca>
On 2019-02-11 9:43 p.m., Simon Marchi wrote:
> On 2019-01-28 3:47 p.m., John Baldwin wrote:
>> child_path returns a pointer to the first component in a child path
>> that comes after a parent path. This does not depend on trying to
>> stat() the paths since they may describe remote paths but instead
>> relies on filename parsing. The function requires that the child path
>> describe a filename that contains at least one component below the
>> parent path and returns a pointer to the first component.
>>
>> gdb/ChangeLog:
>>
>> * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
>> unittests/child-path-selftests.c.
>> * common/pathstuff.c (child_path): New function.
>> * common/pathstuff.h (child_path): New prototype.
>> * unittests/child-path-selftests.c: New file.
>
> Thanks, this LGTM. Just minor comments below.
Oh, and maybe name the function is_child_path or child_path_p?
Simon