diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2003-11-14 12:53:42 +0000 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2003-11-14 12:53:42 +0000 |
commit | eba86e2adbd562c8cb25f7f1377aa9180db2b614 (patch) | |
tree | 1def9bee7e09b2f0f64a664996b7b400cffc8e81 /archival/tar.c | |
parent | e9080c9f4170b6634f8f8373874e758f48df9127 (diff) | |
download | busybox-w32-eba86e2adbd562c8cb25f7f1377aa9180db2b614.tar.gz busybox-w32-eba86e2adbd562c8cb25f7f1377aa9180db2b614.tar.bz2 busybox-w32-eba86e2adbd562c8cb25f7f1377aa9180db2b614.zip |
Catch unsupported features
Diffstat (limited to 'archival/tar.c')
-rw-r--r-- | archival/tar.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/archival/tar.c b/archival/tar.c index 72b4c9952..bee24d84b 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -596,6 +596,7 @@ static llist_t *append_file_list_to_list(llist_t *list) | |||
596 | 596 | ||
597 | 597 | ||
598 | static const char tar_options[]="ctxjT:X:C:f:Opvz"; | 598 | static const char tar_options[]="ctxjT:X:C:f:Opvz"; |
599 | |||
599 | #define CTX_CREATE 1 | 600 | #define CTX_CREATE 1 |
600 | #define CTX_TEST 2 | 601 | #define CTX_TEST 2 |
601 | #define CTX_EXTRACT 4 | 602 | #define CTX_EXTRACT 4 |
@@ -670,21 +671,28 @@ int tar_main(int argc, char **argv) | |||
670 | tar_handle->action_header = header_list; | 671 | tar_handle->action_header = header_list; |
671 | } | 672 | } |
672 | } | 673 | } |
673 | #ifdef CONFIG_FEATURE_TAR_GZIP | 674 | |
674 | if(opt & TAR_OPT_GZIP) { | 675 | if(opt & TAR_OPT_GZIP) { |
675 | get_header_ptr = get_header_tar_gz; | 676 | #ifdef CONFIG_FEATURE_TAR_GZIP |
676 | } | 677 | get_header_ptr = get_header_tar_gz; |
678 | #else | ||
679 | bb_show_usage(); | ||
677 | #endif | 680 | #endif |
678 | #ifdef CONFIG_FEATURE_TAR_BZIP2 | 681 | } |
679 | if(opt & TAR_OPT_BZIP2) { | 682 | if(opt & TAR_OPT_BZIP2) { |
683 | #ifdef CONFIG_FEATURE_TAR_BZIP2 | ||
680 | get_header_ptr = get_header_tar_bz2; | 684 | get_header_ptr = get_header_tar_bz2; |
681 | } | 685 | #else |
686 | bb_show_usage(); | ||
682 | #endif | 687 | #endif |
683 | #ifdef CONFIG_FEATURE_TAR_EXCLUDE | 688 | } |
684 | if(opt & TAR_OPT_EXCLUDE) { | 689 | if(opt & TAR_OPT_EXCLUDE) { |
690 | #ifdef CONFIG_FEATURE_TAR_EXCLUDE | ||
685 | tar_handle->reject = append_file_list_to_list(tar_handle->reject); | 691 | tar_handle->reject = append_file_list_to_list(tar_handle->reject); |
686 | } | 692 | #else |
693 | bb_show_usage(); | ||
687 | #endif | 694 | #endif |
695 | } | ||
688 | /* Check if we are reading from stdin */ | 696 | /* Check if we are reading from stdin */ |
689 | if ((argv[optind]) && (*argv[optind] == '-')) { | 697 | if ((argv[optind]) && (*argv[optind] == '-')) { |
690 | /* Default is to read from stdin, so just skip to next arg */ | 698 | /* Default is to read from stdin, so just skip to next arg */ |