blob: fc1820b97b86e068aff0151e12a2bd07ac149ef6 [file] [log] [blame]
"Robert P. J. Day"63fc1a92006-07-02 19:47:05 +00001/* vi: set sw=4 ts=4: */
Glenn L McGrath7ca04f32002-09-25 02:47:48 +00002/*
Bernhard Reutner-Fischerfa939aa2006-04-05 16:21:37 +00003 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
Glenn L McGrath7ca04f32002-09-25 02:47:48 +00004 */
Denis Vlasenko9a7d38f2007-05-31 22:42:12 +00005
Bernhard Reutner-Fischerfa939aa2006-04-05 16:21:37 +00006#include "libbb.h"
Denis Vlasenko9a7d38f2007-05-31 22:42:12 +00007#include "unarchive.h"
Glenn L McGrath7ca04f32002-09-25 02:47:48 +00008
Rob Landleydfba7412006-03-06 20:47:33 +00009void unpack_ar_archive(archive_handle_t *ar_archive)
Glenn L McGrath7ca04f32002-09-25 02:47:48 +000010{
11 char magic[7];
12
Rob Landley53437472006-07-16 08:14:35 +000013 xread(ar_archive->src_fd, magic, 7);
Glenn L McGrath7ca04f32002-09-25 02:47:48 +000014 if (strncmp(magic, "!<arch>", 7) != 0) {
Denis Vlasenkoe1a0d482006-10-20 13:28:22 +000015 bb_error_msg_and_die("invalid ar magic");
Glenn L McGrath7ca04f32002-09-25 02:47:48 +000016 }
17 ar_archive->offset += 7;
18
19 while (get_header_ar(ar_archive) == EXIT_SUCCESS);
20}