Permalink
Browse files

Enable both seekable and non-seekable modes

  • Loading branch information...
1 parent dd86134 commit dd5f6d01e3dad7d82a0478fff0325c34b5535c2b @vasi committed Nov 5, 2012
Showing with 6 additions and 3 deletions.
  1. +3 −1 list.c
  2. +3 −2 read.c
View
4 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);
View
5 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

0 comments on commit dd5f6d0

Please sign in to comment.