diff options
Diffstat (limited to 'Completion/Core/_path_files')
-rw-r--r-- | Completion/Core/_path_files | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files index bf6049f8f..1e8059e4b 100644 --- a/Completion/Core/_path_files +++ b/Completion/Core/_path_files @@ -249,9 +249,10 @@ elif [[ "$pre" = *\$*/* && "$compstate[quote]" != \" ]]; then # after the first slash after the parameter expansion. # This fails for things like `f/$foo/b/<TAB>' where the first `f' is # meant as a partial path. + linepath="${(M)pre##*\$[^/]##/}" - realpath=$(print -r ${(e)~linepath}) 2>/dev/null - [[ -z "$realpath" || "$realpath" = "$linepath" ]] && return 1 + eval 'realpath=${(e)~linepath}' 2>/dev/null + [[ -z "$realpath" || "$realpath" = "$linepath" ]] && return 1 pre="${pre#${linepath}}" i="${#linepath//[^\\/]}" orig="${orig[1,(in:i:)/][1,-2]}" @@ -323,7 +324,7 @@ for prepath in "$prepaths[@]"; do else compfiles -p$cfopt tmp1 accex "$skipped" "$_matcher" '' fake "$pats[@]" fi - eval 'tmp1=( $~tmp1 )' 2>/dev/null + tmp1=( $~tmp1 ) if [[ -n "$PREFIX$SUFFIX" ]]; then # See which of them match what's on the line. |