diff options
author | Bart Schaefer <barts@users.sourceforge.net> | 2009-11-10 22:17:02 +0000 |
---|---|---|
committer | Bart Schaefer <barts@users.sourceforge.net> | 2009-11-10 22:17:02 +0000 |
commit | f91f79c4571adb3f646613fe0561c497bdea2955 (patch) | |
tree | 0e48cf68da4c61b552d00850402203b1c85b5ed7 /Completion/Unix/Command | |
parent | b159a6bba22f78ec4dad1436572b08d7902adb51 (diff) | |
download | zsh-f91f79c4571adb3f646613fe0561c497bdea2955.tar.gz zsh-f91f79c4571adb3f646613fe0561c497bdea2955.tar.xz zsh-f91f79c4571adb3f646613fe0561c497bdea2955.zip |
Greg Klanderman: 27377 (slightly tweaked): fix ignored (duplicate) file names
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r-- | Completion/Unix/Command/_rm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Completion/Unix/Command/_rm b/Completion/Unix/Command/_rm index 815bbbdf8..21b10d3f6 100644 --- a/Completion/Unix/Command/_rm +++ b/Completion/Unix/Command/_rm @@ -5,7 +5,7 @@ args=( '(-f --force)'{-f,--force}'[ignore nonexistent files, never prompt]' '(-I --interactive)-i[prompt before every removal]' '(-r -R --recursive)'{-r,-R,--recursive}'[remove directories and their contents recursively]' - '*:files:->file' + '*::files:->file' ) if _pick_variant gnu=gnu unix --help; then opts+=(-S) @@ -33,7 +33,10 @@ _arguments -C $opts \ case $state in (file) declare -a ignored - ignored=(${line//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH}) + if ((CURRENT > 1)); then + ignored=(${line[1,CURRENT-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH}) + ignored+=(${line[CURRENT+1,-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH}) + fi _files -F ignored && ret=0 ;; esac |