From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11312 invoked from network); 16 Dec 1999 22:16:49 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 16 Dec 1999 22:16:49 -0000 Received: (qmail 4472 invoked by alias); 16 Dec 1999 22:16:44 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9093 Received: (qmail 4465 invoked from network); 16 Dec 1999 22:16:44 -0000 Date: Thu, 16 Dec 1999 17:16:34 -0500 From: Clint Adams To: zsh-workers@sunsite.auc.dk Subject: PATCH: bzip2 support for _tar, more tar problems Message-ID: <19991216171634.A2131@dman.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0i tar xvzCf /tmp archiv will not complete to archive.tar.gz; instead it attempts to untar /tmp in search of archive within. There should probably be a sanity check first to avoid untarring directories, and then _tar should recognize the -C and pass -W /tmp to _files in _tar_archive. tar --directory=/tmp xvzf archiv, on the other hand, will work, but it is merely doing a _path_files -W /tmp, thus losing all the smarts it would have without the --directory. This should also be calling _tar_archive which in turn should do a -W /tmp. Unfortunately, _tar_archive is counting on $1 containing the flags; I think _tar_archive should take these as arguments. Index: Completion/User/_tar_archive =================================================================== RCS file: /cvs/zsh/zsh/Completion/User/_tar_archive,v retrieving revision 1.1.1.3 diff -u -r1.1.1.3 _tar_archive --- Completion/User/_tar_archive 1999/12/01 15:29:44 1.1.1.3 +++ Completion/User/_tar_archive 1999/12/16 22:12:50 @@ -16,6 +16,8 @@ if [[ "$1" = *[tx]* ]]; then if [[ "$1" = *[zZ]* ]]; then _files "$expl[@]" -g '*.((tar|TAR).(gz|GZ|Z)|.tgz)' + elif [[ "$1" = *I* ]]; then + _files "$expl[@]" -g '*.(tar|TAR).bz2' else _files "$expl[@]" -g '*.(tar|TAR)' fi