summaryrefslogtreecommitdiff
path: root/archival/ar.c
diff options
context:
space:
mode:
authorDenis Vlasenko2008-07-10 23:06:00 +0000
committerDenis Vlasenko2008-07-10 23:06:00 +0000
commit0381d422d9b40c0cf887d299224c7759875aefd8 (patch)
tree764583282951c07bb6b611bef2858c5375647094 /archival/ar.c
parentb6052724ffc9d45894147b70e7aff226938bd2d3 (diff)
downloadbusybox-0381d422d9b40c0cf887d299224c7759875aefd8.zip
busybox-0381d422d9b40c0cf887d299224c7759875aefd8.tar.gz
dpkg_deb: slight code shrink
ar: reuse existing ar unpacking code get_header_tar: handle autodetection for tiny .tar.gz files too unarchive.h: do not include CONFIGed out things function old new delta get_header_tar 1521 1534 +13 dpkg_deb_main 400 380 -20 ar_main 260 196 -64 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 13/-84) Total: -71 bytes
Diffstat (limited to 'archival/ar.c')
-rw-r--r--archival/ar.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/archival/ar.c b/archival/ar.c
index d49329c..dbff677 100644
--- a/archival/ar.c
+++ b/archival/ar.c
@@ -45,7 +45,6 @@ int ar_main(int argc, char **argv)
archive_handle_t *archive_handle;
unsigned opt;
- char magic[8];
archive_handle = init_handle();
@@ -82,14 +81,7 @@ int ar_main(int argc, char **argv)
llist_add_to(&(archive_handle->accept), argv[optind++]);
}
- xread(archive_handle->src_fd, magic, 7);
- if (strncmp(magic, "!<arch>", 7) != 0) {
- bb_error_msg_and_die("invalid ar magic");
- }
- archive_handle->offset += 7;
-
- while (get_header_ar(archive_handle) == EXIT_SUCCESS)
- continue;
+ unpack_ar_archive(archive_handle);
return EXIT_SUCCESS;
}