2
0
mirror of https://github.com/vasi/pixz synced 2024-11-18 15:26:46 +00:00

Enable both seekable and non-seekable modes

This commit is contained in:
Dave Vasilevsky 2012-11-04 21:23:18 -05:00
parent dd86134d64
commit dd5f6d01e3
2 changed files with 6 additions and 3 deletions

4
list.c
View File

@ -3,7 +3,9 @@
#pragma mark FUNCTION DEFINITIONS
void pixz_list(bool tar) {
decode_index();
if (!decode_index())
die("Can't list non-seekable input");
lzma_index_iter iter;
lzma_index_iter_init(&iter, gIndex);

5
read.c
View File

@ -85,7 +85,7 @@ static lzma_vli gFileIndexOffset = 0;
#pragma mark MAIN
void pixz_read(bool verify, size_t nspecs, char **specs) {
if (0 && decode_index()) { // FIXME
if (decode_index()) { // FIXME
if (verify)
gFileIndexOffset = read_file_index();
wanted_files(nspecs, specs);
@ -96,7 +96,8 @@ void pixz_read(bool verify, size_t nspecs, char **specs) {
debug("want: %s", w->name);
#endif
pipeline_create(block_create, block_free, read_thread_noindex, decode_thread);
pipeline_create(block_create, block_free,
gIndex ? read_thread : read_thread_noindex, decode_thread);
if (verify && gFileIndexOffset) {
// FIXME: verify this works with noindex/streamed reading
// FIXME: don't stop on End Of Archive