summaryrefslogtreecommitdiff
blob: 058029b8be284f0bae717fea9677a82838afcd4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--- lv451.orig/index.html
+++ lv451/index.html
@@ -301,8 +301,11 @@
 	<P>
 	Compressed files that have suffix ``gz'', ``z'', or ``GZ'', ``Z'' are
 	extracted by lv using <I>zcat</I> (1),
-	and ``bz2'' or ``BZ2'' with <I>bzcat</I> (1).
-	Please install <I>zcat</I> and <I>bzcat</I> that can expand all of them.
+	``bz2'' or ``BZ2'' with <I>bzcat</I> (1).
+	``lzma'' or ``LZMA'' with <I>lzcat</I> (1).
+	and ``xz'' or ``XZ'' with <I>xzcat</I> (1).
+	Please install <I>zcat</I>, <I>bzcat</I>, <I>lzcat</I> and <I>xzcat</I>
+	that can expand all of them.
 	<P>
 	In case that standard output is not connected to an ordinal terminal
 	but to redirect or pipe-line,
--- lv451.orig/src/stream.c
+++ lv451/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 @@
       filter = gz_filter;
     else if( !strcmp( "bz2", exts ) || !strcmp( "BZ2", exts ) )
       filter = bz2_filter;
+    else if( !strcmp( "lzma", exts ) || !strcmp( "LZMA", exts ) )
+      filter = lzma_filter;
+    else if( !strcmp( "xz", exts ) || !strcmp( "XZ", exts ) )
+      filter = xz_filter;
   }
   if( NULL != filter ){
     /*
-     * zcat or bzcat
+     * zcat or bzcat or lzcat or xzcat
      */
     if( NULL == (st->fp = (FILE *)tmpfile()) )
       perror( "temporary file" ), exit( -1 );