summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-07-10 08:03:36 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-07-10 08:03:36 +0000
commit961876dca4ab10b475ff04d1bc1cf21b929a3495 (patch)
tree011cf3a5b242f356d1dd00e57481437fcb3e1a6a
parent709c31e9a8f7b1d3458adbc7e92cce23dce2abaf (diff)
downloadzsh-961876dca4ab10b475ff04d1bc1cf21b929a3495.tar.gz
zsh-961876dca4ab10b475ff04d1bc1cf21b929a3495.tar.xz
zsh-961876dca4ab10b475ff04d1bc1cf21b929a3495.zip
avoid insertion of `+' before ~1/<TAB>; don't use undeclared local $tmp (12208)
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Core/_path_files18
2 files changed, 15 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 1b9a91edb..7b98178b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-07-10  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* 12208: Completion/Core/_path_files: avoid insertion of `+'
+ 	before ~1/<TAB>; don't use undeclared local $tmp
+	
 2000-07-08  Tanaka Akira  <akr@zsh.org>
 
 	* 12201: Completion/User/_java: fix completion for jar. complete
diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files
index d2de3f230..bf6049f8f 100644
--- a/Completion/Core/_path_files
+++ b/Completion/Core/_path_files
@@ -209,21 +209,23 @@ if [[ "$pre[1]" = \~ && -z "$compstate[quote]" ]]; then
   elif [[ "$linepath" = ([-+]|)[0-9]## ]]; then
     if [[ "$linepath" != [-+]* ]]; then
       if [[ -o pushdminus ]]; then
-        linepath="-$linepath"
+        tmp1="-$linepath"
       else
-        linepath="+$linepath"
+        tmp1="+$linepath"
       fi
+    else
+      tmp1="$linepath"
     fi
     if [[ "$linepath" = -* ]]; then
-      tmp=$(( $#dirstack $linepath ))
+      tmp1=$(( $#dirstack $tmp1 ))
     else
-      tmp=$linepath[2,-1]
+      tmp1=$tmp1[2,-1]
     fi
-    [[ -o pushdminus ]] && tmp=$(( $#dirstack - $tmp ))
-    if (( ! tmp )); then
+    [[ -o pushdminus ]] && tmp1=$(( $#dirstack - $tmp1 ))
+    if (( ! tmp1 )); then
       realpath=$PWD/
-    elif [[ tmp -le $#dirstack ]]; then
-      realpath=$dirstack[tmp]/
+    elif [[ tmp1 -le $#dirstack ]]; then
+      realpath=$dirstack[tmp1]/
     else
       _message 'not enough directory stack entries'
       return 1