Check at least one context is specified
authorGlenn L McGrath <bug1@ihug.co.nz>
Thu, 20 Nov 2003 09:53:31 +0000 (09:53 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Thu, 20 Nov 2003 09:53:31 +0000 (09:53 -0000)
archival/tar.c

index 9ef616b92f5510517d7d8523bde2b411006681dd..c8a2bd38540e17f3d8e44038be998be40d056094 100644 (file)
@@ -662,6 +662,9 @@ int tar_main(int argc, char **argv)
        if(opt & 0x80000000UL)
                bb_show_usage();
        ctx_flag = opt & (CTX_CREATE | CTX_TEST | CTX_EXTRACT);
+       if (ctx_flag == 0) {
+               bb_show_usage();
+       }
        if(ctx_flag & CTX_TEST) {
                if ((tar_handle->action_header == header_list) || 
                        (tar_handle->action_header == header_verbose_list)) {