sbase

suckless unix tools
git clone git://git.suckless.org/sbase
Log | Files | Refs | README | LICENSE

commit 1f0f1dd320d4b37ce1c6bce49e64b7f4c797b45a
parent b6b977f63d08bd646a59158a4de2f1a28240a1f1
Author: FRIGN <dev@frign.de>
Date:   Sat, 21 Mar 2015 14:04:49 +0100

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.

Diffstat:
Mtar.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

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