blob: 81d5f8d7c2d8497ed61447e1b6b186b4dd6c4b73 [file] [log] [blame]
Bernhard Reutner-Fischerfa939aa2006-04-05 16:21:37 +00001/* vi:set ts=4:*/
Glenn L McGrath95ebf612001-10-25 14:18:08 +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 McGrath95ebf612001-10-25 14:18:08 +00004 */
5
Glenn L McGrathd09bcec2003-11-14 08:26:25 +00006#include <stdlib.h>
Glenn L McGrath95ebf612001-10-25 14:18:08 +00007
Glenn L McGrathd09bcec2003-11-14 08:26:25 +00008#include "unarchive.h"
Bernhard Reutner-Fischerfa939aa2006-04-05 16:21:37 +00009#include "libbb.h"
10
11
Glenn L McGrathd09bcec2003-11-14 08:26:25 +000012
13/* If we are reading through a pipe(), or from stdin then we cant lseek,
14 * we must read and discard the data to skip over it.
15 *
16 * TODO: rename to seek_by_read
17 */
Rob Landleydfba7412006-03-06 20:47:33 +000018void seek_by_char(const archive_handle_t *archive_handle, const unsigned int jump_size)
Glenn L McGrath95ebf612001-10-25 14:18:08 +000019{
Glenn L McGrath7ffe1332003-11-21 22:24:57 +000020 if (jump_size) {
Glenn L McGrath15c35122004-02-21 09:20:56 +000021 bb_copyfd_size(archive_handle->src_fd, -1, jump_size);
Glenn L McGrath95ebf612001-10-25 14:18:08 +000022 }
Eric Andersen2276d832002-07-11 11:11:56 +000023}