-#if 0
- 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
- in the current directory, or other filename-specific things.
- If the name begins with a slash, we're either completing a
- full pathname or a directory pathname, and readline won't be
- looking in the current directory anyway, so there's no
- conflict. */
- rl_filename_completion_desired = 0;
+ else if (matches[1] == 0 && CMD_IS_DIR(matches[0]) && dot_in_path == 0)
+ /* If we found a single match, without looking in the current
+ directory (because it's not in $PATH), but the found name is
+ also a command in the current directory, suppress appending any
+ terminating character, since it's ambiguous. */
+ {
+ rl_completion_suppress_append = 1;
+ rl_filename_completion_desired = 0;
+ }