Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/archival/libarchive/decompress_bunzip2.c

    r2725 r3232  
    4141
    4242#include "libbb.h"
    43 #include "archive.h"
     43#include "bb_archive.h"
    4444
    4545/* Constants for Huffman coding */
     
    722722/* Decompress src_fd to dst_fd.  Stops at end of bzip data, not end of file. */
    723723IF_DESKTOP(long long) int FAST_FUNC
    724 unpack_bz2_stream(int src_fd, int dst_fd)
     724unpack_bz2_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd)
    725725{
    726726    IF_DESKTOP(long long total_written = 0;)
     
    729729    int i;
    730730    unsigned len;
     731
     732    if (check_signature16(aux, src_fd, BZIP2_MAGIC))
     733        return -1;
    731734
    732735    outbuf = xmalloc(IOBUF_SIZE);
     
    753756        }
    754757
    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        ) {
    756766            bb_error_msg("bunzip error %d", i);
    757767            break;
     
    788798}
    789799
    790 IF_DESKTOP(long long) int FAST_FUNC
    791 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 
    801800#ifdef TESTING
    802801
     
    813812    char c;
    814813
    815     int i = unpack_bz2_stream_prime(0, 1);
     814    int i = unpack_bz2_stream(0, 1);
    816815    if (i < 0)
    817816        fprintf(stderr, "%s\n", bunzip_errors[-i]);
Note: See TracChangeset for help on using the changeset viewer.