When skipping data, track the position in the bytestream correctly.

Without this, tar -r breaks badly; new entries overwrite the
middle of the archive instead of being added at the end.

Thanks to: Chris Spiegel
This commit is contained in:
Tim Kientzle 2006-08-29 04:59:25 +00:00
parent 89413e6217
commit 02a97525ef
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=161706

View File

@ -265,7 +265,7 @@ archive_decompressor_none_skip(struct archive *a, size_t request)
struct archive_decompress_none *state;
ssize_t bytes_skipped, total_bytes_skipped = 0;
size_t min;
state = a->compression_data;
if (state->fatal)
return (-1);
@ -301,6 +301,7 @@ archive_decompressor_none_skip(struct archive *a, size_t request)
return (bytes_skipped);
}
total_bytes_skipped += bytes_skipped;
a->file_position += bytes_skipped;
request -= bytes_skipped;
state->client_next = state->client_buff;
a->raw_position += bytes_skipped;