summaryrefslogtreecommitdiffhomepage
path: root/archival/libunarchive/unpack_ar_archive.c
diff options
context:
space:
mode:
authorAlexander Shishkin <virtuoso@slind.org>2010-03-15 15:38:09 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-03-15 15:38:09 +0100
commit535584c750820dd6c36011697f9ef89fe0a0698c (patch)
tree6c682a7a6ca7d740529201c759fa4e64d9622797 /archival/libunarchive/unpack_ar_archive.c
parent814da220a5d451c036c9871094253366372676e0 (diff)
ar: add archive creation support
function old new delta ar_main 184 542 +358 output_ar_header - 166 +166 copy_data - 54 +54 filter_replaceable - 19 +19 get_header_ar 409 414 +5 header_verbose_list_ar 85 88 +3 static.msg_unsupported_err 28 - -28 ------------------------------------------------------------------------------ (add/remove: 3/1 grow/shrink: 3/0 up/down: 605/-28) Total: 577 bytes Signed-off-by: Alexander Shishkin <virtuoso@slind.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/libunarchive/unpack_ar_archive.c')
-rw-r--r--archival/libunarchive/unpack_ar_archive.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/archival/libunarchive/unpack_ar_archive.c b/archival/libunarchive/unpack_ar_archive.c
index dc2eec223..300d10e48 100644
--- a/archival/libunarchive/unpack_ar_archive.c
+++ b/archival/libunarchive/unpack_ar_archive.c
@@ -5,16 +5,17 @@
#include "libbb.h"
#include "unarchive.h"
+#include "ar.h"
void FAST_FUNC unpack_ar_archive(archive_handle_t *ar_archive)
{
char magic[7];
- xread(ar_archive->src_fd, magic, 7);
- if (strncmp(magic, "!<arch>", 7) != 0) {
+ xread(ar_archive->src_fd, magic, AR_MAGIC_LEN);
+ if (strncmp(magic, AR_MAGIC, AR_MAGIC_LEN) != 0) {
bb_error_msg_and_die("invalid ar magic");
}
- ar_archive->offset += 7;
+ ar_archive->offset += AR_MAGIC_LEN;
while (get_header_ar(ar_archive) == EXIT_SUCCESS)
continue;