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: Tom Tromey <tromey at redhat dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 11 Jan 2012 14:49:37 -0700
- Subject: Re: RFC: add relative file name handling for linespecs
- References: <m3d3arlez3.fsf@fleche.redhat.com> <83ipkjeagi.fsf@gnu.org>
>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:
Tom> +/* See whether FILENAME matches SEARCH_NAME using the rule that we
Tom> + advertise to the user.
Eli> Why not say explicitly how the names are matched? "The rule we
Eli> advertise" doesn't give any hint where to look for that rule, so the
Eli> issue remains a mystery and requires to read the source to glean what
Eli> this does.
I will mention the manual.
Tom> + /* Either the names must completely match, or the character
Tom> + preceding the trailing SEARCH_NAME segment of FILENAME must be a
Tom> + directory separator. */
Tom> + return (len == search_len
Tom> + || IS_DIR_SEPARATOR (filename[len - search_len - 1]));
Eli> What about the (somewhat perverse) case of "d:foo/bar" and "foo/bar"
Eli> on Windows?
Would something like this work?
|| (HAS_DRIVE_SPEC (filename) && len - search_len == 2)
Tom