This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: XML XInclude support
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 07 Feb 2007 20:15:59 +0200
- Subject: Re: XML XInclude support
- References: <20070129213229.GA17422@nevyn.them.org> <usldo1jdf.fsf@gnu.org> <20070206124910.GA31162@nevyn.them.org>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> 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.