Re: [PATCH 1/5] Introduce build_debug_file_name

Gary Benson
2015-06-18T10:55:34Z

Eli Zaretskii wrote:
> > Date: Wed, 17 Jun 2015 10:47:34 +0100
> > From: Gary Benson <gbenson@redhat.com>
> > Cc: gdb-patches@sourceware.org, cedric.buissart@gmail.com
> >
> > For the case you mention nothing would be stripped (the "d" in
> > that path is !IS_DIR_SEPARATOR) so the filename components would
> > be concatenated verbatim, just as with the original code. The
> > resulting filename may not make sense, but it's not a regression.
>
> But won't we produce "d://foo/bar" as result?

No. build_debug_file_name strips both leading and trailing slashes.
The only ways to get a double slash from build_debug_file_name is to
pass one in in the middle of a string.

build_debug_file_name ("d:", "foo", "bar") -> "d:/foo/bar"
build_debug_file_name ("d:/", "/foo", "bar") -> "d:/foo/bar"
build_debug_file_name ("d:///", "///foo///", "bar") -> "d:/foo/bar"

but

build_debug_file_name("d://foo", "bar") -> "d://foo/bar"

> > I don't believe this series should be blocked unless it breaks
> > something that actually worked before.
>
> If a fix is very simple, why not make it?

I don't understand, what are you asking me to fix?

Thanks,
Gary

--