about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2002-09-19 15:22:17 +0000
committerClint Adams <clint@users.sourceforge.net>2002-09-19 15:22:17 +0000
commit9a8a7cf3acdbe3bdc8efdc5b91836a472b894bf9 (patch)
tree96a13faff024305cefeaa29c371eef60a621f50e
parent2421fe859969171914aac4e9280b96db1b173763 (diff)
downloadzsh-9a8a7cf3acdbe3bdc8efdc5b91836a472b894bf9.tar.gz
zsh-9a8a7cf3acdbe3bdc8efdc5b91836a472b894bf9.tar.xz
zsh-9a8a7cf3acdbe3bdc8efdc5b91836a472b894bf9.zip
17252: Sven: Completion/Unix/Type/_path_files: fix for use of (z) parameter
modifier; the first word in the parameter is parsed like the first word on
a command line, treating parens specially
-rw-r--r--ChangeLog7
-rw-r--r--Completion/Unix/Type/_path_files8
2 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index d97c7dbd3..4f2d49301 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-09-19  Clint Adams  <clint@zsh.org>
+
+        * 17252: Sven: Completion/Unix/Type/_path_files: fix for use of (z)
+        parameter modifier; the first word in the parameter is parsed
+        like the first word on a command line, treating parens
+        specially
+
 2002-09-17  Peter Stephenson  <pws@csr.com>
 
 	* 17673: Src/exec.c, Test/A01grammar.ztst:
diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files
index 5e36a4c2a..664b0d85f 100644
--- a/Completion/Unix/Type/_path_files
+++ b/Completion/Unix/Type/_path_files
@@ -23,9 +23,11 @@ sopt="-${(@j::M)${(@)tmp1#-}#?}"
 (( $tmp1[(I)-[/g]*] )) && haspats=yes
 (( $tmp1[(I)-g*] )) && gopt=yes
 if (( $tmp1[(I)-/] )); then
-  pats=( '*(-/)' ${(z)${(M)tmp1:#-g*}#-g} )
+  pats="${(@)${(@M)tmp1:#-g*}#-g}"
+  pats=( '*(-/)' ${${(z):-x $pats}[2,-1]} )
 else
-  pats=( "${(@z)${(@M)tmp1:#-g*}#-g}" )
+  pats="${(@)${(@M)tmp1:#-g*}#-g}"
+  pats=( ${${(z):-x $pats}[2,-1]} )
 fi
 pats=( "${(@)pats:# #}" )
 
@@ -332,7 +334,7 @@ for prepath in "$prepaths[@]"; do
     else
       compfiles -p$cfopt tmp1 accex "$skipped" "$_matcher $matcher[2]" '' fake "$pats[@]"
     fi
-    tmp1=( $~tmp1 )
+    tmp1=( $~tmp1 ) 2> /dev/null
 
     if [[ -n "$PREFIX$SUFFIX" ]]; then
       # See which of them match what's on the line.