Fixed ugly bug:
"cd /b<TAB>" returned "cd /" with Freddy Vulto's code (see #502804)
This commit is contained in:
parent
df71a7fa48
commit
7d41e12eb7
@ -269,10 +269,18 @@ _filedir()
|
|||||||
|
|
||||||
_expand || return 0
|
_expand || return 0
|
||||||
|
|
||||||
|
local toks=( ) tmp
|
||||||
|
|
||||||
toks=( ${toks[@]} $(
|
toks=( ${toks[@]} $(
|
||||||
compgen -d -- "$(quote_readline "$cur")" | {
|
compgen -d -- "$(quote_readline "$cur")" | {
|
||||||
while read -r tmp; do
|
while read -r tmp; do
|
||||||
[[ -n $tmp ]] && echo $tmp
|
# TODO: I've removed a "[ -n $tmp ] &&" before,
|
||||||
|
# and everything works again. If this bug
|
||||||
|
# suddenly appears again (i.e. "cd /b<TAB>"
|
||||||
|
# becomes "cd /"), remember to check for
|
||||||
|
# other similar conditionals (here and
|
||||||
|
# _filedir_xspec()). --David
|
||||||
|
echo $tmp
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
@ -282,7 +290,7 @@ _filedir()
|
|||||||
toks=( ${toks[@]} $(
|
toks=( ${toks[@]} $(
|
||||||
compgen -f -X "$xspec" -- "$(quote_readline "$cur")" | {
|
compgen -f -X "$xspec" -- "$(quote_readline "$cur")" | {
|
||||||
while read -r tmp; do
|
while read -r tmp; do
|
||||||
[[ -n $tmp ]] && echo $tmp
|
[ -n $tmp ] && echo $tmp
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
@ -9577,10 +9585,12 @@ _filedir_xspec()
|
|||||||
xspec=${xspec#*-X }
|
xspec=${xspec#*-X }
|
||||||
xspec=${xspec%% *}
|
xspec=${xspec%% *}
|
||||||
|
|
||||||
|
local toks=( ) tmp
|
||||||
toks=( ${toks[@]} $(
|
toks=( ${toks[@]} $(
|
||||||
compgen -d -- "$(quote_readline "$cur")" | {
|
compgen -d -- "$(quote_readline "$cur")" | {
|
||||||
while read -r tmp; do
|
while read -r tmp; do
|
||||||
[[ -n $tmp ]] && echo $tmp
|
# see long TODO comment in _filedir() --David
|
||||||
|
echo $tmp
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
@ -9588,7 +9598,7 @@ _filedir_xspec()
|
|||||||
toks=( ${toks[@]} $(
|
toks=( ${toks[@]} $(
|
||||||
eval compgen -f -X $xspec -- "\$(quote_readline "\$cur")" | {
|
eval compgen -f -X $xspec -- "\$(quote_readline "\$cur")" | {
|
||||||
while read -r tmp; do
|
while read -r tmp; do
|
||||||
[[ -n $tmp ]] && echo $tmp
|
[ -n $tmp ] && echo $tmp
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user