Re: XML XInclude support

Eli Zaretskii
2007-02-07T18:16:24Z

> Date: Tue, 6 Feb 2007 07:49:10 -0500
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gdb-patches@sourceware.org
>
> On Fri, Feb 02, 2007 at 08:53:32PM +0200, Eli Zaretskii wrote:
> > > + /* Simple, portable version of dirname that does not modify its
> > > + argument. */
> > > + base = lbasename (filename);
> > > + while (base > filename && IS_DIR_SEPARATOR (base[-1]))
> > > + --base;
> >
> > I'm glad to see portable file-name handling, but this loop needs a
> > small extra to not fail in the case of "d:foo".
>
> Does it? lbasename ("d:foo") will return a pointer to the 'f'. At
> that point base > filename is true, but IS_DIR_SEPARATOR is false,
> so we use "d:" as the directory name. If that's wrong, I don't know
> enough about DOS based filesystems to know why.

"d:" is wrong because when you use it to construct a file name, you
will get "d:/bar", which is generally not in the same directory as
"d:foo".

What you need is to produce "d:." from "d:foo", not "d:".

> > I'd suggest to use @var{document} instead of @var{name}, and reword
> > the last sentence like this:
>
> Is this better?
>
> @noindent
> When @value{GDBN} encounters an element of this form, it will retrieve
> the named XML @var{document}, and replace the inclusion directive with
> the contents of that document. If the current description was read
> using @samp{qXfer}, then so will be the included document;
> @var{document} will be interpreted as the name of an annex. If the
> current description was read from a file, @value{GDBN} will look for
> @var{document} as a file in the same directory where it found the
> original description.

Yes, this is much better.

Thanks.