unpack_ar_archive.c 436 B

1234567891011121314151617181920
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  4. */
  5. #include "libbb.h"
  6. #include "unarchive.h"
  7. void unpack_ar_archive(archive_handle_t *ar_archive)
  8. {
  9. char magic[7];
  10. xread(ar_archive->src_fd, magic, 7);
  11. if (strncmp(magic, "!<arch>", 7) != 0) {
  12. bb_error_msg_and_die("invalid ar magic");
  13. }
  14. ar_archive->offset += 7;
  15. while (get_header_ar(ar_archive) == EXIT_SUCCESS);
  16. }