summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-09-15 17:03:08 +0200
committerZenWalker <[email protected]>2019-10-03 10:26:10 +0200
commitf10463c3de365ebdeb073892f79331c35de4c601 (patch)
treef1f427811c20e2e4179f9ed5a67a9adca52aa116
parentaf0ca89b1991b08325a31a11c133fc6000c5a2cd (diff)
downloadengrampa-f10463c3de365ebdeb073892f79331c35de4c601.tar.bz2
engrampa-f10463c3de365ebdeb073892f79331c35de4c601.tar.xz
Add application/(x-compress|x-rpm|x-lzh-compressed) in local magic
$ file -b --mime-type ~/test.tar.Z application/x-compress $ hexdump -C -n 2 ~/test.tar.Z 00000000 1f 9d |..| 00000002 $ file -b --mime-type ~/atril-1.23.1-1.fc30.src.rpm application/x-rpm $ hexdump -C -n 4 ~/atril-1.23.1-1.fc30.src.rpm 00000000 ed ab ee db |....| 00000004 $ file -b --mime-type ~/test.lzh application/x-lzh-compressed $ hexdump -C -s 2 -n 3 ~/test.lzh 00000002 2d 6c 68 |-lh| 00000005
-rw-r--r--src/fr-archive.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fr-archive.c b/src/fr-archive.c
index eff0afe..2bbf4fa 100644
--- a/src/fr-archive.c
+++ b/src/fr-archive.c
@@ -558,15 +558,19 @@ get_mime_type_from_magic_numbers (GFile *file)
{ 0, 4, "\xce\xb2\xcf\x81", "application/x-brotli" },
{ 0, 3, "BZh", "application/x-bzip2" },
{ 0, 2, "\037\213", "application/x-gzip" },
+ { 2, 3, "-lh", "application/x-lzh-compressed"},
{ 0, 4, "LZIP", "application/x-lzip" },
{ 0, 9, "\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a", "application/x-lzop", },
{ 0, 4, "Rar!", "application/x-rar" },
+ { 0, 4, "\xed\xab\xee\xdb", "application/x-rpm" },
{ 0, 4, "RZIP", "application/x-rzip" },
{ 0, 6, "\3757zXZ\000", "application/x-xz" },
{ 20, 4, "\xdc\xa7\xc4\xfd", "application/x-zoo", },
{ 0, 4, "PK\003\004", "application/zip" },
{ 0, 8, "PK00PK\003\004", "application/zip" },
{ 0, 4, "LRZI", "application/x-lrzip" },
+ { 0, 2, "\x1f\x9d", "application/x-compress" }, /* using Lempel-Ziv-Welch algorithm */
+ { 0, 2, "\x1f\xa0", "application/x-compress" }, /* using Lempel-Ziv-Huffman algorithm */
};
char buffer[32];