Re: [patch gdb]: Fix some DOS-path related issues in gdb

Pedro Alves
2011-03-23T14:44:44Z

On Wednesday 23 March 2011 14:07:01, Kai Tietz wrote:
> @@ -1023,12 +1025,13 @@ elfstab_offset_sections (struct objfile
> struct stab_section_info *maybe = dbx->stab_section_info;
> struct stab_section_info *questionable = 0;
> int i;
> - char *p;
> + const char *p;
>
> /* The ELF symbol info doesn't include path names, so strip the path
> (if any) from the psymtab filename. */
> - while (0 != (p = strchr (filename, '/')))
> - filename = p + 1;
> + p = lbasename (filename);
> + if (p != filename)
> + filename = p;

These three lines are the same as just:

filename = lbasename (filename);

You can then drop the unnecessary `p' local.

The patch looked good to me with that change.

--
Pedro Alves