Show usage() when filtermode is given for tar-creation

We only allow decompression for extraction. Thus, it may be confusing
for the user and break scripts silently when the j- or z-flag are given
even though this is not supported.
This commit is contained in:
FRIGN 2015-03-21 14:04:49 +01:00
parent b6b977f63d
commit 1f0f1dd320

4
tar.c
View File

@ -52,7 +52,7 @@ static ino_t tarinode;
static dev_t tardev; static dev_t tardev;
static int mflag; static int mflag;
static char filtermode; static char filtermode = '\0';
static FILE * static FILE *
decomp(FILE *fp) decomp(FILE *fp)
@ -348,6 +348,8 @@ main(int argc, char *argv[])
if (!mode || argc != (mode == 'c')) if (!mode || argc != (mode == 'c'))
usage(); usage();
if (mode == 'c' && filtermode)
usage();
switch (mode) { switch (mode) {
case 'c': case 'c':