# [tex-k] Bug in TeX and METAFONT

Igor Liferenko igor.liferenko at gmail.com
Thu Oct 29 09:24:11 CET 2020

```Dear all,

To reproduce the problem you need non-TL's TeX and METAFONT.

Run tex on this x.tex:

\input y.idx

This is y.idx:

\ERROR

The output is:

(x.tex (y.idx
! Undefined control sequence.
l.1 \ERROR

?

If we answer `E', we get:

You want to edit file y at line 1

Notice, that extension was stripped from file name,
therefore the editor will not be able to open it.

If the following code is removed from tex.web, the problem disappears:

if name=str_ptr-1 then {we can conserve string pool space now}
begin flush_string; name:=cur_name;
end;

When this code is removed, TRIP test is passed.

For comparison, use this x.tex

\ERROR

Notice, that this time extension is present after `E'.
So, extension is present for master file only and absent for \input files
(this is because x.tex is followed by x.log in string pool and the
"if" check is therefore false).

This is the problem code from mf.web:

if name=str_ptr-1 then {we can conserve string pool space now}
begin flush_string(name); name:=cur_name;
end;

When this code is removed TRAP test is passed.

Test case is similar to TeX.

P.S.
This problem does not concern TL's TeX and METAFONT.
I think this is because they use their own mechanisms for
file searching.
```