[patch 2/9] Code cleanup: Drop IS_ABSOLUTE_PATH checks

Eli Zaretskii eliz@gnu.org
Fri Jan 18 07:32:00 GMT 2013


> Date: Thu, 17 Jan 2013 22:58:46 +0100
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
> 
> compare_filenames_for_search did not support IS_ABSOLUTE_PATH search_name and
> therefore all its callers had to handle such case specially.

What code in compare_filenames_for_search would not DTRT with absolute
file names?

>  int
>  compare_filenames_for_search (const char *filename, const char *search_name)
> @@ -171,7 +171,8 @@ compare_filenames_for_search (const char *filename, const char *search_name)
>       to put the "c:file.c" name into debug info.  Such compatibility
>       works only on GDB built for DOS host.  */
>    return (len == search_len
> -	  || IS_DIR_SEPARATOR (filename[len - search_len - 1])
> +	  || (!IS_ABSOLUTE_PATH (search_name)
> +	      && IS_DIR_SEPARATOR (filename[len - search_len - 1]))
>  	  || (HAS_DRIVE_SPEC (filename)
>  	      && STRIP_DRIVE_SPEC (filename) == &filename[len - search_len]));
>  }

I don't understand why the "match up to a slash" rule is now limited
to non-absolute file names.  Perhaps this is related to my first
question above.

Thanks.



More information about the Gdb-patches mailing list