Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/archival/libarchive/decompress_bunzip2.c
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/archival/libarchive/decompress_bunzip2.c
r2725 r3232 41 41 42 42 #include "libbb.h" 43 #include " archive.h"43 #include "bb_archive.h" 44 44 45 45 /* Constants for Huffman coding */ … … 722 722 /* Decompress src_fd to dst_fd. Stops at end of bzip data, not end of file. */ 723 723 IF_DESKTOP(long long) int FAST_FUNC 724 unpack_bz2_stream( int src_fd, int dst_fd)724 unpack_bz2_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd) 725 725 { 726 726 IF_DESKTOP(long long total_written = 0;) … … 729 729 int i; 730 730 unsigned len; 731 732 if (check_signature16(aux, src_fd, BZIP2_MAGIC)) 733 return -1; 731 734 732 735 outbuf = xmalloc(IOBUF_SIZE); … … 753 756 } 754 757 755 if (i != RETVAL_LAST_BLOCK) { 758 if (i != RETVAL_LAST_BLOCK 759 /* Observed case when i == RETVAL_OK: 760 * "bzcat z.bz2", where "z.bz2" is a bzipped zero-length file 761 * (to be exact, z.bz2 is exactly these 14 bytes: 762 * 42 5a 68 39 17 72 45 38 50 90 00 00 00 00). 763 */ 764 && i != RETVAL_OK 765 ) { 756 766 bb_error_msg("bunzip error %d", i); 757 767 break; … … 788 798 } 789 799 790 IF_DESKTOP(long long) int FAST_FUNC791 unpack_bz2_stream_prime(int src_fd, int dst_fd)792 {793 uint16_t magic2;794 xread(src_fd, &magic2, 2);795 if (magic2 != BZIP2_MAGIC) {796 bb_error_msg_and_die("invalid magic");797 }798 return unpack_bz2_stream(src_fd, dst_fd);799 }800 801 800 #ifdef TESTING 802 801 … … 813 812 char c; 814 813 815 int i = unpack_bz2_stream _prime(0, 1);814 int i = unpack_bz2_stream(0, 1); 816 815 if (i < 0) 817 816 fprintf(stderr, "%s\n", bunzip_errors[-i]);
Note:
See TracChangeset
for help on using the changeset viewer.