Allow up to three discarded characters when detecting gerbers

Some layout programs add a blank block at the beginning but include the
terminating '*' on a line before starting the actual data.  This is
ignored by GerbView so we all this type of behavior in the mimetype file
detection as well

Suggested by Mark Jeronimus

Fixes https://gitlab.com/kicad/code/kicad/issues/12097

(cherry picked from commit 64335d94d715169927e92e7f5ffd0e16438de4db)
This commit is contained in:
Seth Hillbrand 2022-09-10 13:24:55 -07:00
parent 3dfbe582db
commit d52f246b2a

View File

@ -7,13 +7,14 @@
<!--Try to match with some common opening commands-->
<magic priority="50">
<!--A comment line-->
<match type="string" offset="0" value="G04"/>
<!--The possible 3 characters allow for a null block with *CRLF before the data-->
<match type="string" offset="0:3" value="G04"/>
<!--Some setup macros-->
<match type="string" offset="0" value="%FSLA"/>
<match type="string" offset="0" value="%MO"/>
<match type="string" offset="0" value="%TF."/>
<match type="string" offset="0:3" value="%FSLA"/>
<match type="string" offset="0:3" value="%MO"/>
<match type="string" offset="0:3" value="%TF."/>
<!--Seems to be common with files exported from some programs-->
<match type="string" offset="0" value="G75*"/>
<match type="string" offset="0:3" value="G75*"/>
</magic>
</mime-type>
<mime-type type="application/x-gerber-job">