Skip to content

Commit

Permalink
Enable both seekable and non-seekable modes
Browse files Browse the repository at this point in the history
  • Loading branch information
vasi committed Nov 5, 2012
1 parent dd86134 commit dd5f6d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion list.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
5 changes: 3 additions & 2 deletions read.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down

0 comments on commit dd5f6d0

Please sign in to comment.