Check at least one context is specified

This commit is contained in:
Glenn L McGrath 2003-11-20 09:53:31 +00:00
parent ba49651de9
commit bebc40b406

View File

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