diff --git a/bash_completion b/bash_completion index e36b7ffa..d0c24138 100644 --- a/bash_completion +++ b/bash_completion @@ -2,7 +2,7 @@ # # # @@ -1253,7 +1253,10 @@ _cd() fi # standard dir completion if parameter starts with /, ./ or ../ - [[ "$cur" == ?(.)?(.)/* ]] && COMPREPLY=( $( compgen -d $cur ) ) && return 0 + if [[ "$cur" == ?(.)?(.)/* ]]; then + COMPREPLY=( $( compgen -d $cur ) ) + return 0 + fi if [ -n "$CDPATH" ]; then # we have a CDPATH, so loop on its contents for i in ${CDPATH//:/ }; do @@ -1262,9 +1265,8 @@ _cd() # add subdirs to list of completions as necessary [ ${#dirs[@]} ] && COMPREPLY=( ${COMPREPLY[@]} ${dirs[@]#$i/}) done - else - COMPREPLY=( $( compgen -d $cur ) ) fi + COMPREPLY=( $( compgen -d $cur ) ) return 0 }