From 5a29589fcadeac3ae9f1f5f2f8600468d3f90d39 Mon Sep 17 00:00:00 2001 From: Guillaume Rousse Date: Sat, 3 Apr 2010 21:42:13 +0200 Subject: [PATCH] fix _filedir completion for path with non-ascii chars, by evaluating the result of _quote_readline_by_ref --- bash_completion | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bash_completion b/bash_completion index 024b4e09..8626fd28 100644 --- a/bash_completion +++ b/bash_completion @@ -590,7 +590,10 @@ _filedir() # if [[ "$1" != -d ]]; then 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[@]-} $( eval compgen -f -X \"\$xspec\" -- $quoted ) )