[hackers] [sbase] Show usage() when filtermode is given for tar-creation || FRIGN

From: <git_AT_suckless.org>
Date: Mon, 23 Mar 2015 18:35:49 +0100 (CET)

commit 5c81834b54378fe8a6af0f7425d21c3591e2cb13
Author: FRIGN <dev_AT_frign.de>
Date: Sat Mar 21 14:04:49 2015 +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.

diff --git a/tar.c b/tar.c
index 9606515..31cc399 100644
--- a/tar.c
+++ b/tar.c
_AT_@ -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)
_AT_@ -348,6 +348,8 @@ main(int argc, char *argv[])
 
         if (!mode || argc != (mode == 'c'))
                 usage();
+ if (mode == 'c' && filtermode)
+ usage();
 
         switch (mode) {
         case 'c':
Received on Mon Mar 23 2015 - 18:35:49 CET

This archive was generated by hypermail 2.3.0 : Mon Mar 23 2015 - 18:36:15 CET