Package: lv
Version: 4.51-2
Severity: wishlist
Tags: patch

It would be nice if lv could automatically decompress xz and lzma
compressed files.

The following patch works for me; it should probably be reviewed by
someone who actually understands the code:

--- a/src/stream.c
+++ b/src/stream.c
@@ -43,6 +43,8 @@

 private byte *gz_filter = "zcat";
 private byte *bz2_filter = "bzcat";
+private byte *lzma_filter = "lzcat";
+private byte *xz_filter = "xzcat";

 private stream_t *StreamAlloc()
 {
@@ -75,10 +77,14 @@ public stream_t *StreamOpen( byte *file )
       filter = gz_filter;
     else if( !strcmp( "bz2", exts ) || !strcmp( "BZ2", exts ) )
       filter = bz2_filter;
+    else if ( !strcmp( "lzma", exts ) )
+      filter = lzma_filter;
+    else if ( !strcmp( "xz", exts ) )
+      filter = xz_filter;
   }
   if( NULL != filter ){
     /*
-     * zcat or bzcat
+     * zcat, bzcat etc.
      */
     if( NULL == (st->fp = (FILE *)tmpfile()) )
       perror( "temporary file" ), exit( -1 );



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to