aboutsummaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2012-03-22 13:15:08 +0000
committerRon Yorston <rmy@pobox.com>2012-03-22 13:15:08 +0000
commitc0d4367d6b581eb5989c02815880cf0fa2851ae8 (patch)
tree868c266e627e2d7f65ba5a4d5f98a1c421453181 /archival
parentf6bad5ef766b0447158e3de2f55c35f1f6cecb58 (diff)
parentda4441c44f6efccb6f7b7588404d9c6bfb7b6af8 (diff)
downloadbusybox-w32-c0d4367d6b581eb5989c02815880cf0fa2851ae8.tar.gz
busybox-w32-c0d4367d6b581eb5989c02815880cf0fa2851ae8.tar.bz2
busybox-w32-c0d4367d6b581eb5989c02815880cf0fa2851ae8.zip
Merge commit 'da4441c44f6efccb6f7b7588404d9c6bfb7b6af8' into merge
Conflicts: libbb/vfork_daemon_rexec.c networking/wget.c procps/ps.c
Diffstat (limited to 'archival')
-rw-r--r--archival/libarchive/get_header_tar_gz.c4
-rw-r--r--archival/lzop.c2
-rw-r--r--archival/tar.c29
3 files changed, 21 insertions, 14 deletions
diff --git a/archival/libarchive/get_header_tar_gz.c b/archival/libarchive/get_header_tar_gz.c
index b09f8691c..889fed0d9 100644
--- a/archival/libarchive/get_header_tar_gz.c
+++ b/archival/libarchive/get_header_tar_gz.c
@@ -9,7 +9,7 @@
9char FAST_FUNC get_header_tar_gz(archive_handle_t *archive_handle) 9char FAST_FUNC get_header_tar_gz(archive_handle_t *archive_handle)
10{ 10{
11#if BB_MMU 11#if BB_MMU
12 unsigned char magic[2]; 12 uint16_t magic;
13#endif 13#endif
14 14
15 /* Can't lseek over pipes */ 15 /* Can't lseek over pipes */
@@ -21,7 +21,7 @@ char FAST_FUNC get_header_tar_gz(archive_handle_t *archive_handle)
21#if BB_MMU 21#if BB_MMU
22 xread(archive_handle->src_fd, &magic, 2); 22 xread(archive_handle->src_fd, &magic, 2);
23 /* Can skip this check, but error message will be less clear */ 23 /* Can skip this check, but error message will be less clear */
24 if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) { 24 if (magic != GZIP_MAGIC) {
25 bb_error_msg_and_die("invalid gzip magic"); 25 bb_error_msg_and_die("invalid gzip magic");
26 } 26 }
27#endif 27#endif
diff --git a/archival/lzop.c b/archival/lzop.c
index 094e78cf9..62455c313 100644
--- a/archival/lzop.c
+++ b/archival/lzop.c
@@ -401,7 +401,7 @@ struct globals {
401#define INIT_G() do { } while (0) 401#define INIT_G() do { } while (0)
402//#define G (*ptr_to_globals) 402//#define G (*ptr_to_globals)
403//#define INIT_G() do { 403//#define INIT_G() do {
404// SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); 404// SET_PTR_TO_GLOBALS(xzalloc(sizeof(G)));
405//} while (0) 405//} while (0)
406 406
407 407
diff --git a/archival/tar.c b/archival/tar.c
index 150c6f393..74d6fca91 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -657,7 +657,7 @@ static llist_t *append_file_list_to_list(llist_t *list)
657 llist_t *newlist = NULL; 657 llist_t *newlist = NULL;
658 658
659 while (list) { 659 while (list) {
660 src_stream = xfopen_for_read(llist_pop(&list)); 660 src_stream = xfopen_stdin(llist_pop(&list));
661 while ((line = xmalloc_fgetline(src_stream)) != NULL) { 661 while ((line = xmalloc_fgetline(src_stream)) != NULL) {
662 /* kill trailing '/' unless the string is just "/" */ 662 /* kill trailing '/' unless the string is just "/" */
663 char *cp = last_char_is(line, '/'); 663 char *cp = last_char_is(line, '/');
@@ -722,11 +722,16 @@ static void handle_SIGCHLD(int status)
722#endif 722#endif
723 723
724//usage:#define tar_trivial_usage 724//usage:#define tar_trivial_usage
725//usage: "-[" IF_FEATURE_TAR_CREATE("c") "xt" IF_FEATURE_SEAMLESS_GZ("z") 725//usage: "-[" IF_FEATURE_TAR_CREATE("c") "xt"
726//usage: IF_FEATURE_SEAMLESS_BZ2("j") IF_FEATURE_SEAMLESS_LZMA("a") 726//usage: IF_FEATURE_SEAMLESS_Z("Z")
727//usage: IF_FEATURE_SEAMLESS_Z("Z") IF_FEATURE_TAR_NOPRESERVE_TIME("m") "vO] " 727//usage: IF_FEATURE_SEAMLESS_GZ("z")
728//usage: IF_FEATURE_TAR_FROM("[-X FILE] ") 728//usage: IF_FEATURE_SEAMLESS_BZ2("j")
729//usage: "[-f TARFILE] [-C DIR] [FILE]..." 729//usage: IF_FEATURE_SEAMLESS_LZMA("a")
730//usage: IF_FEATURE_TAR_CREATE("h")
731//usage: IF_FEATURE_TAR_NOPRESERVE_TIME("m")
732//usage: "vO] "
733//usage: IF_FEATURE_TAR_FROM("[-X FILE] [-T FILE] ")
734//usage: "[-f TARFILE] [-C DIR] [FILE]..."
730//usage:#define tar_full_usage "\n\n" 735//usage:#define tar_full_usage "\n\n"
731//usage: IF_FEATURE_TAR_CREATE("Create, extract, ") 736//usage: IF_FEATURE_TAR_CREATE("Create, extract, ")
732//usage: IF_NOT_FEATURE_TAR_CREATE("Extract ") 737//usage: IF_NOT_FEATURE_TAR_CREATE("Extract ")
@@ -741,6 +746,9 @@ static void handle_SIGCHLD(int status)
741//usage: "\n f Name of TARFILE ('-' for stdin/out)" 746//usage: "\n f Name of TARFILE ('-' for stdin/out)"
742//usage: "\n C Change to DIR before operation" 747//usage: "\n C Change to DIR before operation"
743//usage: "\n v Verbose" 748//usage: "\n v Verbose"
749//usage: IF_FEATURE_SEAMLESS_Z(
750//usage: "\n Z (De)compress using compress"
751//usage: )
744//usage: IF_FEATURE_SEAMLESS_GZ( 752//usage: IF_FEATURE_SEAMLESS_GZ(
745//usage: "\n z (De)compress using gzip" 753//usage: "\n z (De)compress using gzip"
746//usage: ) 754//usage: )
@@ -750,9 +758,6 @@ static void handle_SIGCHLD(int status)
750//usage: IF_FEATURE_SEAMLESS_LZMA( 758//usage: IF_FEATURE_SEAMLESS_LZMA(
751//usage: "\n a (De)compress using lzma" 759//usage: "\n a (De)compress using lzma"
752//usage: ) 760//usage: )
753//usage: IF_FEATURE_SEAMLESS_Z(
754//usage: "\n Z (De)compress using compress"
755//usage: )
756//usage: "\n O Extract to stdout" 761//usage: "\n O Extract to stdout"
757//usage: IF_FEATURE_TAR_CREATE( 762//usage: IF_FEATURE_TAR_CREATE(
758//usage: "\n h Follow symlinks" 763//usage: "\n h Follow symlinks"
@@ -1057,8 +1062,10 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
1057 tar_handle->src_fd = tar_fd; 1062 tar_handle->src_fd = tar_fd;
1058 tar_handle->seek = seek_by_read; 1063 tar_handle->seek = seek_by_read;
1059 } else { 1064 } else {
1060 if (ENABLE_FEATURE_TAR_AUTODETECT && flags == O_RDONLY) { 1065 if (ENABLE_FEATURE_TAR_AUTODETECT
1061 get_header_ptr = get_header_tar; 1066 && flags == O_RDONLY
1067 && get_header_ptr == get_header_tar
1068 ) {
1062 tar_handle->src_fd = open_zipped(tar_filename); 1069 tar_handle->src_fd = open_zipped(tar_filename);
1063 if (tar_handle->src_fd < 0) 1070 if (tar_handle->src_fd < 0)
1064 bb_perror_msg_and_die("can't open '%s'", tar_filename); 1071 bb_perror_msg_and_die("can't open '%s'", tar_filename);