"Robert P. J. Day" | 63fc1a9 | 2006-07-02 19:47:05 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
Glenn L McGrath | 95ebf61 | 2001-10-25 14:18:08 +0000 | [diff] [blame] | 2 | /* |
Bernhard Reutner-Fischer | fa939aa | 2006-04-05 16:21:37 +0000 | [diff] [blame] | 3 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
Glenn L McGrath | 95ebf61 | 2001-10-25 14:18:08 +0000 | [diff] [blame] | 4 | */ |
| 5 | |
Glenn L McGrath | d09bcec | 2003-11-14 08:26:25 +0000 | [diff] [blame] | 6 | #include <stdlib.h> |
Glenn L McGrath | 95ebf61 | 2001-10-25 14:18:08 +0000 | [diff] [blame] | 7 | |
Glenn L McGrath | d09bcec | 2003-11-14 08:26:25 +0000 | [diff] [blame] | 8 | #include "unarchive.h" |
Bernhard Reutner-Fischer | fa939aa | 2006-04-05 16:21:37 +0000 | [diff] [blame] | 9 | #include "libbb.h" |
| 10 | |
Denis Vlasenko | 1385899 | 2006-10-08 12:49:22 +0000 | [diff] [blame] | 11 | /* If we are reading through a pipe(), or from stdin then we cant lseek, |
Glenn L McGrath | d09bcec | 2003-11-14 08:26:25 +0000 | [diff] [blame] | 12 | * we must read and discard the data to skip over it. |
Glenn L McGrath | d09bcec | 2003-11-14 08:26:25 +0000 | [diff] [blame] | 13 | */ |
Denis Vlasenko | 1385899 | 2006-10-08 12:49:22 +0000 | [diff] [blame] | 14 | void seek_by_read(const archive_handle_t *archive_handle, const unsigned int jump_size) |
Glenn L McGrath | 95ebf61 | 2001-10-25 14:18:08 +0000 | [diff] [blame] | 15 | { |
Glenn L McGrath | 7ffe133 | 2003-11-21 22:24:57 +0000 | [diff] [blame] | 16 | if (jump_size) { |
Glenn L McGrath | 15c3512 | 2004-02-21 09:20:56 +0000 | [diff] [blame] | 17 | bb_copyfd_size(archive_handle->src_fd, -1, jump_size); |
Glenn L McGrath | 95ebf61 | 2001-10-25 14:18:08 +0000 | [diff] [blame] | 18 | } |
Eric Andersen | 2276d83 | 2002-07-11 11:11:56 +0000 | [diff] [blame] | 19 | } |