summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2009-11-12 04:19:42 +0000
committerBart Schaefer <barts@users.sourceforge.net>2009-11-12 04:19:42 +0000
commit31012c47d5dca7862f7962a583aaaa4deb98a50c (patch)
tree27f271fe236a78cbe032894494bc3fb261e19efa
parent96feec40a58d0cd1a72cad4c5ce3e5475ca3d82d (diff)
downloadzsh-31012c47d5dca7862f7962a583aaaa4deb98a50c.tar.gz
zsh-31012c47d5dca7862f7962a583aaaa4deb98a50c.tar.xz
zsh-31012c47d5dca7862f7962a583aaaa4deb98a50c.zip
Greg K: Replace 27377 with 27391.
-rw-r--r--ChangeLog8
-rw-r--r--Completion/Unix/Command/_rm7
2 files changed, 8 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 8b0f2a984..024ff2521 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2009-11-11  Barton E. Schaefer  <schaefer@zsh.org>
 
+	* Greg Klanderman: 27391: Completion/Unix/Command/_rm:
+	 fix ignored (duplicate) file names
+	
 	* users/14548: Src/Modules/termcap.c: prevent libtermcap from
 	exiting on an unknown terminal type
 
@@ -11,9 +14,6 @@
 
 2009-11-10  Barton E. Schaefer  <schaefer@zsh.org>
 
-	* Greg Klanderman: 27377 (slightly tweaked):
-	Completion/Unix/Command/_rm: fix ignored (duplicate) file names
-
 	* 27368, 27369: FEATURES: replace one incorrect example with two
 	correct ones
 
@@ -12336,5 +12336,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4809 $
+* $Revision: 1.4810 $
 *****************************************************
diff --git a/Completion/Unix/Command/_rm b/Completion/Unix/Command/_rm
index 21b10d3f6..20f44afc5 100644
--- a/Completion/Unix/Command/_rm
+++ b/Completion/Unix/Command/_rm
@@ -33,10 +33,11 @@ _arguments -C $opts \
 case $state in
   (file)
     declare -a ignored
-    if ((CURRENT > 1)); then
-      ignored=(${line[1,CURRENT-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
+    ignored=()
+    ((CURRENT > 1)) &&
+      ignored+=(${line[1,CURRENT-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
+    ((CURRENT < $#line)) &&
       ignored+=(${line[CURRENT+1,-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
-    fi
     _files -F ignored && ret=0
     ;;
 esac