diff options
author | Oliver Kiddle <opk@users.sourceforge.net> | 2002-01-02 17:14:08 +0000 |
---|---|---|
committer | Oliver Kiddle <opk@users.sourceforge.net> | 2002-01-02 17:14:08 +0000 |
commit | eabe9ea6f8115f3f385a4407459ed574954da460 (patch) | |
tree | ac30662c261c1537bd42b83567437254a7809328 /Completion/Unix/Command/_zip | |
parent | 8074e07a2ced99c4464d4a72cb93f47a7aacf34b (diff) | |
download | zsh-eabe9ea6f8115f3f385a4407459ed574954da460.tar.gz zsh-eabe9ea6f8115f3f385a4407459ed574954da460.tar.xz zsh-eabe9ea6f8115f3f385a4407459ed574954da460.zip |
users/4561: fix code for finding the zipfile's name in the current command-line
Diffstat (limited to 'Completion/Unix/Command/_zip')
-rw-r--r-- | Completion/Unix/Command/_zip | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Completion/Unix/Command/_zip b/Completion/Unix/Command/_zip index 7d4509e6f..6f83b748f 100644 --- a/Completion/Unix/Command/_zip +++ b/Completion/Unix/Command/_zip @@ -1,6 +1,6 @@ #compdef zip unzip zipinfo -local suffixes suf zipfile izip uzi +local suffixes suf zipfile uzi local expl curcontext="$curcontext" state line typeset -A opt_args @@ -114,9 +114,7 @@ case $state in if [[ $service = zip ]] && (( ! ${+opt_args[-d]} )); then _files -g '^(#i)*.(zip|[jw]ar)' && return 0 else - (( izip = 1 + words[(I)-[^xi]*] )) - (( izip == 1 )) && (( izip++ )) - zipfile=( $~words[izip](|.zip|.ZIP) ) + zipfile=( $~line[1](|.zip|.ZIP) ) [[ -z $zipfile[1] ]] && return 1 if [[ $zipfile[1] != $_zip_cache_list ]]; then _zip_cache_name="$zipfile[1]" |