about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2003-02-24 11:33:04 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2003-02-24 11:33:04 +0000
commitf1fd8273b44fb232651e72ceb4af1da8492ea447 (patch)
tree2fade887f7afcf3f76747cdcfaf7251b7eab51aa /Completion
parentb1ae269e555cb3997ebac0ceae936f563e3c67c1 (diff)
downloadzsh-f1fd8273b44fb232651e72ceb4af1da8492ea447.tar.gz
zsh-f1fd8273b44fb232651e72ceb4af1da8492ea447.tar.xz
zsh-f1fd8273b44fb232651e72ceb4af1da8492ea447.zip
18230: Test for explicitly matched file in _path_files.
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Type/_path_files23
1 files changed, 22 insertions, 1 deletions
diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files
index 45308bc93..b4d6e105e 100644
--- a/Completion/Unix/Type/_path_files
+++ b/Completion/Unix/Type/_path_files
@@ -324,8 +324,11 @@ for prepath in "$prepaths[@]"; do
     fi
 
     # Force auto-mounting. There might be a better way...
+    # Commented out in the hope that `pws non-canonical hack'
+    # down below does this for us.  Can be uncommented if it
+    # doesn't.
 
-    : ${^tmp1}/${PREFIX}${SUFFIX}/.(/)
+    # : ${^tmp1}/${PREFIX}${SUFFIX}/.(/)
 
     # Get the matching files by globbing.
 
@@ -343,6 +346,24 @@ for prepath in "$prepaths[@]"; do
     if [[ -n "$PREFIX$SUFFIX" ]]; then
       # See which of them match what's on the line.
 
+      # pws non-canonical hack which seems to work so far...
+      # if we didn't match by globbing, check that there is
+      # something to match by explicit name.  This is for
+      # `clever' filing systems where names pop into existence
+      # when referenced.
+      if (( ! $#tmp1 )); then
+	  for tmp3 in "$tmp2[@]"; do
+	      if [[ -n $tmp3 && $tmp3 != */ ]]; then
+		  tmp3+=/
+	      fi
+	      if [[ -e "$tmp3${(Q)PREFIX}${(Q)SUFFIX}" ]] then
+		  ## DEBUG
+		  print "added $tmp3${(Q)PREFIX}${(Q)SUFFIX}" >&2
+		  tmp1+=("$tmp3${(Q)PREFIX}${(Q)SUFFIX}")
+	      fi
+	  done
+      fi
+
       if (( ! $#tmp1 )); then
         tmp2=( ${^tmp2}/$PREFIX$SUFFIX )
       elif [[ "$tmp1[1]" = */* ]]; then