"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 | |
| 11 | |
Glenn L McGrath | d09bcec | 2003-11-14 08:26:25 +0000 | [diff] [blame] | 12 | |
| 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 Landley | dfba741 | 2006-03-06 20:47:33 +0000 | [diff] [blame] | 18 | void seek_by_char(const archive_handle_t *archive_handle, const unsigned int jump_size) |
Glenn L McGrath | 95ebf61 | 2001-10-25 14:18:08 +0000 | [diff] [blame] | 19 | { |
Glenn L McGrath | 7ffe133 | 2003-11-21 22:24:57 +0000 | [diff] [blame] | 20 | if (jump_size) { |
Glenn L McGrath | 15c3512 | 2004-02-21 09:20:56 +0000 | [diff] [blame] | 21 | bb_copyfd_size(archive_handle->src_fd, -1, jump_size); |
Glenn L McGrath | 95ebf61 | 2001-10-25 14:18:08 +0000 | [diff] [blame] | 22 | } |
Eric Andersen | 2276d83 | 2002-07-11 11:11:56 +0000 | [diff] [blame] | 23 | } |