This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: completion regression? [PATCH]


 > 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.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]