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