diff options
author | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-11-15 23:19:05 +0000 |
---|---|---|
committer | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-11-15 23:19:05 +0000 |
commit | 890b323fe84c1c37da0b097ed89253cad5e6587a (patch) | |
tree | fe3d7ead1f80f5b56e44e52a651f368adf92c91d /archival/unzip.c | |
parent | 99b184aaae050c3613f7e34dad61c8f21cfa63ac (diff) | |
download | busybox-w32-890b323fe84c1c37da0b097ed89253cad5e6587a.tar.gz busybox-w32-890b323fe84c1c37da0b097ed89253cad5e6587a.tar.bz2 busybox-w32-890b323fe84c1c37da0b097ed89253cad5e6587a.zip |
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.
git-svn-id: svn://busybox.net/trunk/busybox@7917 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'archival/unzip.c')
-rw-r--r-- | archival/unzip.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/archival/unzip.c b/archival/unzip.c index f2d7f4918..c670073f4 100644 --- a/archival/unzip.c +++ b/archival/unzip.c | |||
@@ -199,7 +199,8 @@ extern int unzip_main(int argc, char **argv) | |||
199 | archive_handle->action_data(archive_handle); | 199 | archive_handle->action_data(archive_handle); |
200 | } else { | 200 | } else { |
201 | dst_fd = bb_xopen(archive_handle->file_header->name, O_WRONLY | O_CREAT); | 201 | dst_fd = bb_xopen(archive_handle->file_header->name, O_WRONLY | O_CREAT); |
202 | inflate(archive_handle->src_fd, dst_fd); | 202 | inflate_init(zip_header.formated.cmpsize); |
203 | inflate_unzip(archive_handle->src_fd, dst_fd); | ||
203 | close(dst_fd); | 204 | close(dst_fd); |
204 | chmod(archive_handle->file_header->name, archive_handle->file_header->mode); | 205 | chmod(archive_handle->file_header->name, archive_handle->file_header->mode); |
205 | 206 | ||
@@ -227,10 +228,8 @@ extern int unzip_main(int argc, char **argv) | |||
227 | /* Data descriptor section */ | 228 | /* Data descriptor section */ |
228 | if (zip_header.formated.flags & 4) { | 229 | if (zip_header.formated.flags & 4) { |
229 | /* skip over duplicate crc, compressed size and uncompressed size */ | 230 | /* skip over duplicate crc, compressed size and uncompressed size */ |
230 | unsigned short i; | 231 | unsigned char data_description[12]; |
231 | for (i = 0; i != 12; i++) { | 232 | archive_xread_all(archive_handle, data_description, 12); |
232 | archive_xread_char(archive_handle); | ||
233 | } | ||
234 | archive_handle->offset += 12; | 233 | archive_handle->offset += 12; |
235 | } | 234 | } |
236 | } | 235 | } |