From dd5f6d01e3dad7d82a0478fff0325c34b5535c2b Mon Sep 17 00:00:00 2001 From: Dave Vasilevsky Date: Sun, 4 Nov 2012 21:23:18 -0500 Subject: [PATCH] Enable both seekable and non-seekable modes --- list.c | 4 +++- read.c | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/list.c b/list.c index 9798d29..3dbf614 100644 --- a/list.c +++ b/list.c @@ -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); diff --git a/read.c b/read.c index eb25bfd..5058b16 100644 --- a/read.c +++ b/read.c @@ -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