blob: f4d8c2f2b5dd5f61c7feb054ae8e600c08191f9a [file] [log] [blame]
"Robert P. J. Day"63fc1a92006-07-02 19:47:05 +00001/* vi: set sw=4 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}