about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2002-05-08 12:56:46 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2002-05-08 12:56:46 +0000
commit6d73a3b843ac1961ccce067a0c191c1bcdf20d7f (patch)
treef01c25c2d4857affc271e6dbc2f66d1bf3cb918f
parent9c397ee1e0ebdab5451b0146c7ce5a433af77b14 (diff)
downloadzsh-6d73a3b843ac1961ccce067a0c191c1bcdf20d7f.tar.gz
zsh-6d73a3b843ac1961ccce067a0c191c1bcdf20d7f.tar.xz
zsh-6d73a3b843ac1961ccce067a0c191c1bcdf20d7f.zip
17072: fix pushdminus handling in completion after directory stack references
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Unix/Type/_path_files17
2 files changed, 12 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index ae723a4a9..427668a70 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-05-03  Oliver Kiddle  <opk@zsh.org>
+
+	* 17072; based on 17066 (Danek Duvall):
+	Completion/Unix/Type/_path_files: correct handling of pushdminus
+	in completion after directory stack references
+
 2002-04-30  Clint Adams  <clint@zsh.org>
 
         * 16349: Completion/Debian/Command/.distfiles,
diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files
index 32bf51fef..a6d2a2834 100644
--- a/Completion/Unix/Type/_path_files
+++ b/Completion/Unix/Type/_path_files
@@ -220,20 +220,15 @@ elif [[ "$pre[1]" = \~ && -z "$compstate[quote]" ]]; then
     realpath="${HOME%/}/"
   elif [[ "$linepath" = ([-+]|)[0-9]## ]]; then
     if [[ "$linepath" != [-+]* ]]; then
-      if [[ -o pushdminus ]]; then
-        tmp1="-$linepath"
-      else
-        tmp1="+$linepath"
-      fi
-    else
       tmp1="$linepath"
-    fi
-    if [[ "$linepath" = -* ]]; then
-      tmp1=$(( $#dirstack $tmp1 ))
     else
-      tmp1=$tmp1[2,-1]
+      if [[ "$linepath" = -* ]]; then
+        tmp1=$(( $#dirstack $linepath ))
+      else
+        tmp1=$linepath[2,-1]
+      fi
+      [[ -o pushdminus ]] && tmp1=$(( $#dirstack - $tmp1 ))
     fi
-    [[ -o pushdminus ]] && tmp1=$(( $#dirstack - $tmp1 ))
     if (( ! tmp1 )); then
       realpath=$PWD/
     elif [[ tmp1 -le $#dirstack ]]; then