fix _filedir completion for path with non-ascii chars, by evaluating the result of _quote_readline_by_ref

This commit is contained in:
Guillaume Rousse 2010-04-03 21:42:13 +02:00
parent 35c795bdbb
commit 5a29589fca

View File

@ -590,7 +590,10 @@ _filedir()
# #
if [[ "$1" != -d ]]; then if [[ "$1" != -d ]]; then
xspec=${1:+"!*.$1"} xspec=${1:+"!*.$1"}
if [[ ${cur:0:1} == "'" && ${BASH_VERSINFO[0]} -ge 4 ]]; then # in some situation, _quote_readline_by_ref actually overquote,
# hence the need to eval the result
if [[ ${cur:0:1} == "'" && ${BASH_VERSINFO[0]} -ge 4 ]] || \
[[ ${quoted:0:1} == '$' ]]; then
toks=( ${toks[@]-} $( toks=( ${toks[@]-} $(
eval compgen -f -X \"\$xspec\" -- $quoted eval compgen -f -X \"\$xspec\" -- $quoted
) ) ) )