about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-12-23 22:07:01 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-12-23 22:07:01 +0000
commitaac49ecdbd155c75e06f2632fc66f065c26c75b2 (patch)
tree35d3bb148f28b24eefac33773a697d558b872d8d
parentdf6b4aadbb61ed663eede25f8f4a4c7f193fc824 (diff)
downloadzsh-aac49ecdbd155c75e06f2632fc66f065c26c75b2.tar.gz
zsh-aac49ecdbd155c75e06f2632fc66f065c26c75b2.tar.xz
zsh-aac49ecdbd155c75e06f2632fc66f065c26c75b2.zip
zsh-workers/9149
-rw-r--r--Completion/Builtins/_cd4
-rw-r--r--Completion/Core/_path_files4
2 files changed, 6 insertions, 2 deletions
diff --git a/Completion/Builtins/_cd b/Completion/Builtins/_cd
index 8e72bd7ad..6e1790df3 100644
--- a/Completion/Builtins/_cd
+++ b/Completion/Builtins/_cd
@@ -37,9 +37,11 @@ elif _popd || [[ $PREFIX != (\~|/|./|../)* && $#cdpath -ne 0 ]]; then
       PREFIX="~$PREFIX"
       _path_files -/
   else
+    local tmpcdpath
+    tmpcdpath=(${(@)cdpath:#.})
     _alternative \
         'local-directories:local directories:_path_files -/' \
-	"path-directories: directories in cdpath:_path_files -W \\(${${(@)cdpath:#.}}\\) -/"
+	"path-directories:directories in cdpath:_path_files -W tmpcdpath -/"
   fi
 else
   _path_files -/
diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files
index dd9934506..39e02fb58 100644
--- a/Completion/Core/_path_files
+++ b/Completion/Core/_path_files
@@ -44,7 +44,9 @@ while getopts "P:S:qr:R:W:F:J:V:X:f/g:M:12n" opt; do
          if [[ "$tmp1[1]" = '(' ]]; then
            prepaths=( ${^=tmp1[2,-2]%/}/ )
          else
-           prepaths=( ${(P)^=tmp1%/}/ )
+	   # In this case the variable should be an array, so
+	   # don't use an extra ${=...}.
+           prepaths=( ${(P)^tmp1%/}/ )
            (( ! $#prepaths )) && prepaths=( ${tmp1%/}/ )
          fi
          (( ! $#prepaths )) && prepaths=( '' )