#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.
* the class could test itself.
*/
-#define longest_magic 3
+#define longest_magic 14 /* lzma_alone */
io_stream *
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;
}