Magic for text/x-tex broken
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
shared-mime-info (Ubuntu) |
Fix Released
|
High
|
Unassigned |
Bug Description
The magic for text/x-tex in Ubuntu 15.04 is broken as it assigns text/x-tex to any text file which contains the word "section", "chapter" or "documentclass" within the first 100 characters.
This behavior is fixed if one adds backslashes to the appropriate match values in /usr/share/
Edit: You can reproduce this bug as follows.
Is (output on Ubuntu 15.04):
user@host:
Version: 1.3-1
user@host:
<mime-type type="text/x-tex">
<comment>TeX document</comment>
<comment xml:lang="ar">مستند TeX</comment>
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang="eu">TeX dokumentua<
<comment xml:lang=
<comment xml:lang="fo">TeX skjal</comment>
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang="he">מסמך TeX</comment>
<comment xml:lang="hr">TeX dokument</comment>
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang="ja">TeX ドキュメント</comment>
<comment xml:lang="kk">TeX құжаты</comment>
<comment xml:lang="ko">TeX 문서</comment>
<comment xml:lang="lt">TeX dokumentas<
<comment xml:lang="lv">TeX dokuments</comment>
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang="sr">ТеХ документ</comment>
<comment xml:lang=
<comment xml:lang="tr">TeX belgesi</comment>
<comment xml:lang=
<comment xml:lang="vi">Tài liệu TeX</comment>
<comment xml:lang=
<comment xml:lang=
<sub-class-of type="text/plain"/>
<alias type="applicati
<glob pattern="*.tex"/>
<glob pattern="*.ltx"/>
<glob pattern="*.sty"/>
<glob pattern="*.cls"/>
<glob pattern="*.dtx"/>
<glob pattern="*.ins"/>
<glob pattern="*.latex"/>
<magic priority="10">
<match value="%" type="string" offset="0"/>
</magic>
<magic priority="50">
<match value="
</magic>
<magic priority="50">
<match value="\chapter" type="string" offset="0:100"/>
</magic>
<magic priority="50">
<match value="\section" type="string" offset="0:100"/>
</magic>
</mime-type>
user@host:
user@host:
no_tex: text/x-tex
user@host:
user@host:
tex_file.tex: text/x-tex
Should (is, after patching):
user@host:
<mime-type type="text/x-tex">
<comment>TeX document</comment>
<comment xml:lang="ar">مستند TeX</comment>
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang="eu">TeX dokumentua<
<comment xml:lang=
<comment xml:lang="fo">TeX skjal</comment>
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang="he">מסמך TeX</comment>
<comment xml:lang="hr">TeX dokument</comment>
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang="ja">TeX ドキュメント</comment>
<comment xml:lang="kk">TeX құжаты</comment>
<comment xml:lang="ko">TeX 문서</comment>
<comment xml:lang="lt">TeX dokumentas<
<comment xml:lang="lv">TeX dokuments</comment>
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang=
<comment xml:lang="sr">ТеХ документ</comment>
<comment xml:lang=
<comment xml:lang="tr">TeX belgesi</comment>
<comment xml:lang=
<comment xml:lang="vi">Tài liệu TeX</comment>
<comment xml:lang=
<comment xml:lang=
<sub-class-of type="text/plain"/>
<alias type="applicati
<glob pattern="*.tex"/>
<glob pattern="*.ltx"/>
<glob pattern="*.sty"/>
<glob pattern="*.cls"/>
<glob pattern="*.dtx"/>
<glob pattern="*.ins"/>
<glob pattern="*.latex"/>
<magic priority="10">
<match value="%" type="string" offset="0"/>
</magic>
<magic priority="50">
<match value="
</magic>
<magic priority="50">
<match value="\\chapter" type="string" offset="0:100"/>
</magic>
<magic priority="50">
<match value="\\section" type="string" offset="0:100"/>
</magic>
</mime-type>
user@host:
user@host:
no_tex: text/plain
user@host:
user@host:
tex_file.tex: text/x-tex
description: | updated |
Changed in shared-mime-info (Ubuntu): | |
status: | New → Incomplete |
The attachment "fix_x- tex_magic. patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.
[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]