File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -3051,15 +3051,11 @@ _comp_compgen_filedir_xspec()
3051
3051
3052
3052
((${# toks[@]} )) || return 1
3053
3053
3054
- # Remove . and .. (as well as */. and */..) from suggestions,
3055
- # unless .. or */.. was typed explicitly by the user
3056
- # (for users who use tab-completion to append a slash after '..')
3057
- if [[ ${cur} != @(..|*/..) ]]; then
3058
- local i
3059
- for i in " ${! toks[@]} " ; do
3060
- [[ ${toks[$i]} == @(.|..|*/.|*/..) ]] &&
3061
- unset -v " toks[$i ]"
3062
- done
3054
+ # Remove . and .. (as well as */. and */..) from suggestions, unless .. or
3055
+ # */.. was typed explicitly by the user (for users who use tab-completion
3056
+ # to append a slash after '..')
3057
+ if [[ $cur != ?(*/).. ]]; then
3058
+ _comp_compgen -Rv toks -- -X '?(*/)@(.|..)' -W '" ${toks[@]} " ' || return 1
3063
3059
fi
3064
3060
3065
3061
compopt -o filenames
You can’t perform that action at this time.
0 commit comments