summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2020-12-30 23:55:43 +0200
committerDavid Faure <faure@kde.org>2020-12-31 10:09:16 +0000
commit6b207a2cfd0b59cd231adce6d648dc9871e7253a (patch)
treec68451eff05184fd1331b48dd5ca4d6e6c6266cd
parenta0ea5b059ac67cbd815077521a7683f504ab79d8 (diff)
downloadshared-mime-info-6b207a2cfd0b59cd231adce6d648dc9871e7253a.tar.gz
text/vnd.trolltech.linguist: require space or start tag closing > in magic
https://doc.qt.io/qt-5/linguist-ts-file-format.html Avoids some more MPEG TS confusion. Hopefully that is -- I haven't been able to locate MPEG TS samples that would be misdetected as Linguist files in the first place. But because of that, I think it's fair to assume that the sequence `<TS` is not that common in them, and thus it followed by a space or the start tag closing `>` could be even less common. Not checking for `<TS/` as the root element may not be empty per the DTD. Per [0] checking other whitespace besides the common space isn't necessary either. Refs https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/10 [0] https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/103#note_741219
-rw-r--r--data/freedesktop.org.xml.in3
1 files changed, 2 insertions, 1 deletions
diff --git a/data/freedesktop.org.xml.in b/data/freedesktop.org.xml.in
index 18ee9399..91360a0e 100644
--- a/data/freedesktop.org.xml.in
+++ b/data/freedesktop.org.xml.in
@@ -2856,7 +2856,8 @@ command to generate the output files.
<comment>message catalog</comment>
<sub-class-of type="application/xml"/>
<magic>
- <match type="string" value="&lt;TS" offset="0:256"/>
+ <match type="string" value="&lt;TS " offset="0:256"/>
+ <match type="string" value="&lt;TS&gt;" offset="0:256"/>
</magic>
<glob pattern="*.ts"/>
<alias type="application/x-linguist"/>