This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: add relative file name handling for linespecs


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]