From: Lady Date: Wed, 31 Jan 2024 05:34:32 +0000 (-0500) Subject: Reduce the strength of magic matches X-Git-Tag: 0.5.0~8 X-Git-Url: https://git.ladys.computer/Shushe/commitdiff_plain/6a2e42ac0e7daa97ee0aecc72ddcff9b288470e2?ds=sidebyside;hp=7a1d08550e14638941e9411326f3ecc736e993a0 Reduce the strength of magic matches The strength of magic matches is based on the length of the first line. Boost this by `100` by default, but add an additional `10` for each byte in additional match lines. This should provide a more comfortable set of default strengths to work with. --- diff --git a/magic/css b/magic/css index 24bbf5a..718ce18 100644 --- a/magic/css +++ b/magic/css @@ -1,14 +1,14 @@ 0 string /*css CSS text !:mime text/css -!:strength + 255 +!:strength + 100 0 string @charset\ " CSS text !:mime text/css -!:strength + 255 +!:strength + 100 0 byte 0xEF >1 byte 0xBB >>2 byte 0xBF >>>3 string @charset\ " CSS text !:mime text/css -!:strength + 255 +!:strength + 130 diff --git a/magic/js b/magic/js index 971c95f..aa8cbc5 100644 --- a/magic/js +++ b/magic/js @@ -1,7 +1,7 @@ 0 string #!js Javascript text !:mime text/javascript -!:strength + 255 +!:strength + 100 0 string #!javascript Javascript text !:mime text/javascript -!:strength + 255 +!:strength + 100 diff --git a/magic/record-jar b/magic/record-jar index f4140d3..8fddcbd 100644 --- a/magic/record-jar +++ b/magic/record-jar @@ -1,10 +1,10 @@ 0 string %% record-jar text !:mime text/record-jar -!:strength + 255 +!:strength + 100 0 byte 0xEF >1 byte 0xBB >>2 byte 0xBF >>>3 string %% record-jar text !:mime text/record-jar -!:strength + 255 +!:strength + 140 diff --git a/magic/tsv b/magic/tsv index de72924..2bc05fd 100644 --- a/magic/tsv +++ b/magic/tsv @@ -1,10 +1,10 @@ 0 string #!tsv TSV text !:mime text/tab-separated-values -!:strength + 255 +!:strength + 100 0 byte 0xEF >1 byte 0xBB >>2 byte 0xBF >>>3 string #!tsv TSV text !:mime text/tab-separated-values -!:strength + 255 +!:strength + 170 diff --git a/magic/xml b/magic/xml index d441701..5a9a28f 100644 --- a/magic/xml +++ b/magic/xml @@ -1,10 +1,10 @@ 0 string \1 byte 0xBB >>2 byte 0xBF >>>3 string \