summaryrefslogtreecommitdiff
path: root/bash/bash-2.05b/bash205b-003.patch
blob: 020248b873e84dc362ef2c2525260b1a251ac28a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
*** ../bash-2.05b/bashline.c	Tue May  7 15:52:42 2002
--- bashline.c	Sat Aug  3 11:40:16 2002
***************
*** 1045,1049 ****
--- 1045,1052 ----
        else
  	{
+ #define CMD_IS_DIR(x)	(absolute_pathname(x) == 0 && *(x) != '~' && test_for_directory (x))
+ 
  	  matches = rl_completion_matches (text, command_word_completion_function);
+ 
  	  /* If we are attempting command completion and nothing matches, we
  	     do not want readline to perform filename completion for us.  We
***************
*** 1053,1057 ****
  	  if (matches == (char **)NULL)
  	    rl_ignore_some_completions_function = bash_ignore_filenames;
! 	  else if (matches[1] == 0 && *matches[0] != '/')
  	    /* Turn off rl_filename_completion_desired so readline doesn't
  	       append a slash if there is a directory with the same name
--- 1056,1060 ----
  	  if (matches == (char **)NULL)
  	    rl_ignore_some_completions_function = bash_ignore_filenames;
! 	  else if (matches[1] == 0 && CMD_IS_DIR(matches[0]))
  	    /* Turn off rl_filename_completion_desired so readline doesn't
  	       append a slash if there is a directory with the same name
***************
*** 1062,1066 ****
  	       conflict. */
  	    rl_filename_completion_desired = 0;
! 	  else if (matches[0] && matches[1] && STREQ (matches[0], matches[1]) && *matches[0] != '/')
  	    /* There are multiple instances of the same match (duplicate
  	       completions haven't yet been removed).  In this case, all of
--- 1065,1069 ----
  	       conflict. */
  	    rl_filename_completion_desired = 0;
! 	  else if (matches[0] && matches[1] && STREQ (matches[0], matches[1]) && CMD_IS_DIR (matches[0]))
  	    /* There are multiple instances of the same match (duplicate
  	       completions haven't yet been removed).  In this case, all of