about summary refs log tree commit diff
path: root/Completion/Core/_path_files
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-12-15 17:35:20 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-12-15 17:35:20 +0000
commit8bc41ba869dbbd3c6bc2c8f2338c740311074f23 (patch)
treed595aeb0a5e399d4cb6a7dfd3818c395e9118ec0 /Completion/Core/_path_files
parente401df24821d873eba579d2961a0886881b0acf6 (diff)
downloadzsh-8bc41ba869dbbd3c6bc2c8f2338c740311074f23.tar.gz
zsh-8bc41ba869dbbd3c6bc2c8f2338c740311074f23.tar.xz
zsh-8bc41ba869dbbd3c6bc2c8f2338c740311074f23.zip
manual/9058
Diffstat (limited to 'Completion/Core/_path_files')
-rw-r--r--Completion/Core/_path_files11
1 files changed, 8 insertions, 3 deletions
diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files
index bbed17a1f..dd9934506 100644
--- a/Completion/Core/_path_files
+++ b/Completion/Core/_path_files
@@ -4,7 +4,7 @@
 # to complete to `/usr/local/bin'.
 
 local linepath realpath donepath prepath testpath exppath
-local tmp1 tmp2 tmp3 tmp4 i orig pre suf tpre tsuf opre osuf cpre
+local tmp1 tmp2 tmp3 tmp4 i orig eorig pre suf tpre tsuf opre osuf cpre
 local pats haspats=no ignore group expl addpfx addsfx remsfx
 local nm=$compstate[nmatches] menu match matcher mopts atmp
 
@@ -108,6 +108,7 @@ suf="$SUFFIX"
 opre="$PREFIX"
 osuf="$SUFFIX"
 orig="${PREFIX}${SUFFIX}"
+eorig="$orig"
 
 [[ $compstate[insert] = (*menu|[0-9]*) || -n "$_comp_correct" ||
    ( $#compstate[pattern_match] -ne 0 &&
@@ -265,7 +266,11 @@ for prepath in "$prepaths[@]"; do
 	  if [[ "$tmp2[1]" = */* ]]; then
 	    tmp2=( "${(@)tmp2:h}" )
 	    compquote tmp2
-	    exppaths=( "$exppaths[@]" ${^tmp2}/${tpre}${tsuf} )
+	    if [[ "$tmp2" = */ ]]; then
+	      exppaths=( "$exppaths[@]" ${^tmp2}${tpre}${tsuf} )
+	    else
+	      exppaths=( "$exppaths[@]" ${^tmp2}/${tpre}${tsuf} )
+	    fi
           else
 	    exppaths=( "$exppaths[@]" ${tpre}${tsuf} )
 	  fi
@@ -453,7 +458,7 @@ done
 # expanded paths that are different from the string on the line, we add
 # them as possible matches.
 
-exppaths=( "${(@)exppaths:#$orig}" )
+exppaths=( "${(@)exppaths:#$eorig}" )
 
 if zstyle -t ":completion${curcontext}:paths" expand prefix &&
    [[ $#exppaths -gt 0 && nm -eq compstate[nmatches] ]]; then