This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Remove a trailing space resulting from file name completion
- From: Daniel Jacobowitz <drow at false dot org>
- To: "Maciej W. Rozycki" <macro at mips dot com>
- Cc: gdb-patches at sourceware dot org, Chris Dearman <chris at mips dot com>, "Maciej W. Rozycki" <macro at linux-mips dot org>
- Date: Thu, 10 May 2007 09:17:32 -0400
- Subject: Re: Remove a trailing space resulting from file name completion
- References: <Pine.LNX.4.61.0705101326150.29962@perivale.mips.com>
On Thu, May 10, 2007 at 02:06:32PM +0100, Maciej W. Rozycki wrote:
> Hi,
>
> There is an annoying problem with file name completion when it comes to
> internal variables. When a command like:
>
> (gdb) set logging file log.txt<Tab>
>
> is issued (<Tab> here denoting a stroke of the named key) and "log.txt"
> already exists, then a space is appended (of course it may not make too
> much sense to use completion at the very end of the "log.txt" string, but
> it may earlier). After issuing the command as is, this space is included
> in the variable holding the log file name and consequently, if the log
> file is subsequently written, it is created with the trailing space, i.e.
> as "log.txt ". The space has to be explicitly deleted if this is not
> desired.
>
> As a file with a trailing space is indeed not desired in about any case,
> I propose the following change to be included.
OK. I have an Evil Plan for fixing this more thoroughly, which will
change the quoting of most "set" commands to be more consistent and
friendlier to paths containing spaces and backslashes. But since I
still have not gotten to it, I think this is a step in the right direction.
--
Daniel Jacobowitz
CodeSourcery