Move from read_gz to the pipe()+fork() method.
open_transformer(), common code for pipe+fork. Function pointer for read() no longer needed. Allow inflate to be initialised with a specified buffer size to avoid over-reading. Reset static variables in inflate_get_next_window to fix a bug where only the first file in a .zip would be be extracted.
This commit is contained in:
@@ -424,7 +424,7 @@ got_huff_bits:
|
||||
are ignored, data is written to out_fd and return is RETVAL_OK or error.
|
||||
*/
|
||||
|
||||
extern int read_bunzip(bunzip_data *bd, char *outbuf, int len)
|
||||
static int read_bunzip(bunzip_data *bd, char *outbuf, int len)
|
||||
{
|
||||
const unsigned int *dbuf;
|
||||
int pos,current,previous,gotcount;
|
||||
@@ -511,7 +511,7 @@ decode_next_byte:
|
||||
/* Allocate the structure, read file header. If in_fd==-1, inbuf must contain
|
||||
a complete bunzip file (len bytes long). If in_fd!=-1, inbuf and len are
|
||||
ignored, and data is read from file handle into temporary buffer. */
|
||||
extern int start_bunzip(bunzip_data **bdp, int in_fd, char *inbuf, int len)
|
||||
static int start_bunzip(bunzip_data **bdp, int in_fd, char *inbuf, int len)
|
||||
{
|
||||
bunzip_data *bd;
|
||||
unsigned int i,j,c;
|
||||
|
||||
Reference in New Issue
Block a user