This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: completion regression? [PATCH]
- From: Nick Roberts <nickrob at snap dot net dot nz>
- To: Daniel Jacobowitz <drow at false dot org>, gdb-patches at sources dot redhat dot com
- Date: Wed, 11 Oct 2006 23:49:06 +1300
- Subject: Re: completion regression? [PATCH]
- References: <17705.28835.758720.533078@kahikatea.snap.net.nz> <20061008220814.GA23132@nevyn.them.org> <17708.6256.497894.641872@kahikatea.snap.net.nz>
> Could the "complete" command also add trailing slashes as with completion
> from the command line? i.e
>
> (top-gdb) complete cd test
> cd testrun.log
> cd testrun.sum
> cd testsuite/
> (gdb)
Like below?
--
Nick http://www.inet.net.nz/~nickrob
2006-10-11 Nick Roberts <nickrob@snap.net.nz>
* completer.c (filename_completer): Add a trailing slash for
directories.
*** completer.c 18 Dec 2005 11:33:59 +1300 1.17
--- completer.c 11 Oct 2006 23:45:42 +1300
***************
*** 156,163 ****
{
char *q;
if (word == text)
! /* Return exactly p. */
! return_val[return_val_used++] = p;
else if (word > text)
{
/* Return some portion of p. */
--- 156,168 ----
{
char *q;
if (word == text)
! {
! struct stat finfo;
! /* Return exactly p (with a trailing slash if a directory). */
! if (stat (p, &finfo) == 0 && S_ISDIR (finfo.st_mode))
! p = xstrprintf ("%s/", p);
! return_val[return_val_used++] = p;
! }
else if (word > text)
{
/* Return some portion of p. */