]> cygwin.com Git - cygwin-apps/setup.git/blobdiff - compress.cc
Use solver to check for problems and produce a list of package transactions
[cygwin-apps/setup.git] / compress.cc
index f30745ca4f1f6a4e608e31bc57225d63034b3c2d..7052f96085ea55453b64f0d27b25f47da8fa932d 100644 (file)
@@ -16,6 +16,8 @@
 #include "compress.h"
 #include "compress_gz.h"
 #include "compress_bz.h"
+#include "compress_xz.h"
+#include <string.h>
 
 /* In case you are wondering why the file magic is not in one place:
  * It could be. But there is little (any?) benefit.
@@ -26,7 +28,7 @@
  * the class could test itself. 
  */
 
-#define longest_magic 3
+#define longest_magic 14 /* lzma_alone */
 
 io_stream *
 compress::decompress (io_stream * original)
@@ -57,6 +59,16 @@ compress::decompress (io_stream * original)
          delete rv;
          return NULL;
        }
+      else if (compress_xz::is_xz_or_lzma (magic, 14))
+       {
+         compress_xz *rv = new compress_xz (original);
+         if (!rv->error ())
+           return rv;
+         /* else */
+         rv->release_original();
+         delete rv;
+         return NULL;
+       }
     }
   return NULL;
 }
This page took 0.021977 seconds and 5 git commands to generate.