From: Christos Zoulas Date: Sun, 5 Jan 2014 15:55:21 +0000 (+0000) Subject: Add lz4 support (Ville Skytta) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6cc0dd4e7f5563fc93334db91bdb021b4522f7d8;p=file Add lz4 support (Ville Skytta) --- diff --git a/magic/Magdir/compress b/magic/Magdir/compress index 846a9c3f..ea2a35c9 100644 --- a/magic/Magdir/compress +++ b/magic/Magdir/compress @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: compress,v 1.52 2013/12/11 17:55:00 christos Exp $ +# $File: compress,v 1.53 2014/01/05 15:55:21 christos Exp $ # compress: file(1) magic for pure-compression formats (no archives) # # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc. @@ -209,6 +209,12 @@ >5 byte x \b.%d !:mime application/x-lrzip +# http://fastcompression.blogspot.fi/2013/04/lz4-streaming-format-final.html +0 lelong 0x184d2204 LZ4 compressed data +!:mime application/x-lz4 +0 lelong 0x184c2102 LZ4 compressed data, legacy format +!:mime application/x-lz4 + # AFX compressed files (Wolfram Kleff) 2 string -afx- AFX compressed file data diff --git a/src/compress.c b/src/compress.c index b04383e4..45251b1d 100644 --- a/src/compress.c +++ b/src/compress.c @@ -35,7 +35,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: compress.c,v 1.72 2013/11/18 17:54:58 christos Exp $") +FILE_RCSID("@(#)$File: compress.c,v 1.73 2014/01/05 15:55:21 christos Exp $") #endif #include "magic.h" @@ -80,6 +80,7 @@ private const struct { { "LZIP", 4, { "lzip", "-cdq", NULL }, 1 }, { "\3757zXZ\0",6,{ "xz", "-cd", NULL }, 1 }, /* XZ Utils */ { "LRZI", 4, { "lrzip", "-dqo-", NULL }, 1 }, /* LRZIP */ + { "\004\"M\030", 4, { "lz4", "-cd", NULL }, 1 }, /* LZ4 */ }; #define NODATA ((size_t)~0)