summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Command/_zip6
2 files changed, 5 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index ccc439102..7820a2b7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2002-01-02 Oliver Kiddle <opk@zsh.org>
+ * users/4561: Completion/Unix/Command/_zip: fix bug with finding
+ the zipfile's name in the current command-line.
+
* 16384: Completion/X/Type/.distfiles, Completion/X/Type/_x_visual,
Completion/X/Command/.distfiles, Completion/X/Command/_xloadimage,
Completion/X/Command/_netscape, Completion/X/Command/_x_utils,
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]"