summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2004-05-30 00:09:43 +0000
committerkientzle <kientzle@FreeBSD.org>2004-05-30 00:09:43 +0000
commitb1210dbf1b5ad332cfc9cd3dc8ba7a709e49dcf4 (patch)
treef010c27a210a9a81c2fa4cf88298529ef945096d /usr.bin
parent1b2d9d1890abcc6a878c4e9e18cc4a6b9437b898 (diff)
downloadFreeBSD-src-b1210dbf1b5ad332cfc9cd3dc8ba7a709e49dcf4.zip
FreeBSD-src-b1210dbf1b5ad332cfc9cd3dc8ba7a709e49dcf4.tar.gz
Permit (but ignore) -Z with -x or -t, now that libarchive
recognizes and decompresses .Z format.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tar/bsdtar.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/usr.bin/tar/bsdtar.c b/usr.bin/tar/bsdtar.c
index 6542fe7..4037e06 100644
--- a/usr.bin/tar/bsdtar.c
+++ b/usr.bin/tar/bsdtar.c
@@ -330,8 +330,11 @@ main(int argc, char **argv)
bsdtar->create_compression = opt;
break;
case 'Z': /* GNU tar */
- bsdtar_warnc(bsdtar, 0, ".Z compression not supported");
- usage(bsdtar);
+ if (bsdtar->create_compression != '\0')
+ bsdtar_errc(bsdtar, 1, 0,
+ "Can't specify both -%c and -%c", opt,
+ bsdtar->create_compression);
+ bsdtar->create_compression = opt;
break;
case 'z': /* GNU tar, star */
if (bsdtar->create_compression != '\0')
@@ -369,6 +372,10 @@ main(int argc, char **argv)
only_mode(bsdtar, mode, "-l", "cr");
/* Check other parameters only permitted in certain modes. */
+ if (bsdtar->create_compression == 'Z' && mode == 'c') {
+ bsdtar_warnc(bsdtar, 0, ".Z compression not supported");
+ usage(bsdtar);
+ }
if (bsdtar->create_compression != '\0') {
strcpy(buff, "-?");
buff[1] = bsdtar->create_compression;
OpenPOWER on IntegriCloud