This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFC: add relative file name handling for linespecs
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 10 Jan 2012 19:25:33 +0200
- Subject: Re: RFC: add relative file name handling for linespecs
- References: <m3d3arlez3.fsf@fleche.redhat.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: Tom Tromey <tromey@redhat.com>
> Date: Tue, 10 Jan 2012 09:06:08 -0700
>
> This needs at least a doc review.
Thanks, the documentation parts are okay.
> +/* See whether FILENAME matches SEARCH_NAME using the rule that we
> + advertise to the user.
Why not say explicitly how the names are matched? "The rule we
advertise" doesn't give any hint where to look for that rule, so the
issue remains a mystery and requires to read the source to glean what
this does.
> + /* Either the names must completely match, or the character
> + preceding the trailing SEARCH_NAME segment of FILENAME must be a
> + directory separator. */
> + return (len == search_len
> + || IS_DIR_SEPARATOR (filename[len - search_len - 1]));
What about the (somewhat perverse) case of "d:foo/bar" and "foo/bar"
on Windows?