BASH PATCH REPORT ================= Bash-Release: 2.05b Patch-ID: bash205b-003 Bug-Reported-by: jan.q.bruun-andersen@posten.se Bug-Reference-ID: Bug-Reference-URL: http://mail.gnu.org/pipermail/bug-bash/2002-July/004789.html Bug-Description: In certain cases, Bash appends a space instead of a slash to a directory name relative to the current directory when performing command name completion. This affects partial completion of intermediate directory names. Patch: *** ../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