File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -30,10 +30,13 @@ _comp_cmd_cd()
30
30
_comp_readline_variable_on mark-symlinked-directories && mark_symdirs=y
31
31
32
32
# we have a CDPATH, so loop on its contents
33
- for i in ${CDPATH//:/ $' \n ' } ; do
33
+ local paths dirs
34
+ _comp_split -F : paths " $CDPATH "
35
+ for i in " ${paths[@]} " ; do
34
36
# create an array of matched subdirs
35
37
k=${# COMPREPLY[@]}
36
- for j in $( compgen -d -- " $i /$cur " ) ; do
38
+ _comp_compgen -v dirs -c " $i /$cur " -- -d
39
+ for j in " ${dirs[@]} " ; do
37
40
if [[ ($mark_symdirs && -L $j || $mark_dirs && ! -L $j ) && ! -d ${j# " $i /" } ]]; then
38
41
j+=" /"
39
42
fi
Original file line number Diff line number Diff line change @@ -85,10 +85,11 @@ _comp_cmd_mplayer()
85
85
dirs=(/usr/share/mplayer/skins /usr/local/share/mplayer/skins)
86
86
fi
87
87
88
- local IFS= $' \n '
88
+ local -a subdirs
89
89
for i in ~ /.mplayer/skins " ${dirs[@]} " ; do
90
90
if [[ -d $i && -r $i ]]; then
91
- for j in $( compgen -d -- " $i /$cur " ) ; do
91
+ _comp_compgen -v subdirs -c " $i /$cur " -- -d
92
+ for j in " ${subdirs[@]} " ; do
92
93
COMPREPLY[k++]=${j# " $i /" }
93
94
done
94
95
fi
You can’t perform that action at this time.
0 commit comments