File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -39,13 +39,13 @@ _comp_cmd_cd__compgen_cdpath()
3939 _comp_split -F : paths " $CDPATH "
4040 for _p in " ${paths[@]} " ; do
4141 # create an array of matched subdirs
42- _comp_compgen -v dirs -c " $_p /$cur " -- -d
43- for _d in " ${dirs[@]} " ; do
44- if [[ ($_mark_symdirs && -L $_d || $_mark_dirs && ! -L $_d ) && ! -d ${_d# " $_p /" } ]]; then
45- _d+=" /"
46- fi
47- _cdpaths+=(" ${_d# " $_p /" } " )
48- done
42+ _comp_compgen -v dirs -c " $_p /$cur " -- -d &&
43+ for _d in " ${dirs[@]} " ; do
44+ if [[ ($_mark_symdirs && -L $_d || $_mark_dirs && ! -L $_d ) && ! -d ${_d# " $_p /" } ]]; then
45+ _d+=" /"
46+ fi
47+ _cdpaths+=(" ${_d# " $_p /" } " )
48+ done
4949 done
5050 _comp_unlocal paths dirs
5151
@@ -56,7 +56,8 @@ _comp_cmd_cd__compgen_cdpath()
5656 fi
5757 fi
5858
59- _comp_compgen_set " ${_cdpaths[@]} "
59+ (( ${# _cdpaths[@]} )) &&
60+ _comp_compgen_set " ${_cdpaths[@]} "
6061}
6162
6263_comp_cmd_cd ()
You can’t perform that action at this time.
0 commit comments