[metapost] Uninitialized variable sometimes causing malformed TFM files

Marcel Krüger tex at 2krueger.de
Wed Mar 20 20:26:22 CET 2019




 ---- On Wed, 20 Mar 2019 19:01:08 +0100 luigi scarso <luigi.scarso at gmail.com> wrote ----
 > 
 > 
 > On Wed, Mar 20, 2019 at 6:54 PM Marcel Krüger <tex at 2krueger.de> wrote:
 >  ---- On Wed, 20 Mar 2019 18:29:09 +0100 luigi scarso <luigi.scarso at gmail.com> wrote ----
 >  > 
 >  > 
 >  > On Sat, Mar 16, 2019 at 6:04 PM Marcel Krüger <tex at 2krueger.de> wrote:
 >  > 
 >  > sorry for delay, I will it asap. -- 
 >  > luigi
 > 
 > Thanks. There is one other thing, I do not really know if I would describe it as a backward compatibility bug or a feature request:
 > 
 > For non-"scaled" numbersystems, code like
 > 
 > filldraw stroke z1e--z2e;
 > (example taken from cmbase.mf, `left_bracket`)
 > 
 > fail, because z1e-- is interpreted as z 1e- - instead of z1e --. So z1e--z2e is equal to z1-z2e, leading to lots of errors.
 > 
 > I understand that the new numbersystems and the exponential syntax can lead to problems of this kind, but I think this could be avoided:
 > Maybe a `e+` / `e-` could only be interpreted as exponential notation if it is followed by a  digit? I do not think
 > anyone would write "1e-" or "3e+" for 1 or 3, so it should not lead to any breakage.
 > On the other hand it would catch almost all cases where this is invoked accidentially.
 > 
 > A possible implementation of this change  is attached.
 > 
 > 
 > hm it looks like a serious bug, and I fear I will not able to fix it for next TL --- but I hope to put it into trunk immediately after the TL code is frozen.
 > 

Right, I am sorry for bringing this up so late in the TL cycle.

One additional note on this: The behaviour described above (`1e-` being interpreted as `1`) seems to be specific to the `double` mode.
The `decimal` mode just fails because it is not able to parse the number, which further reduces the risk of breaking some code by changing the current
behaviour.

Also I attached a fixed version of the earlier patch, there was a smaller error.

Best regards,
Marcel Krüger

 > 
 > -- 
 > luigi
 >
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MP-digit-change.diff
Type: application/octet-stream
Size: 2129 bytes
Desc: not available
URL: <https://tug.org/pipermail/metapost/attachments/20190320/1771fe3c/attachment.obj>


More information about the metapost mailing list