[tex-k] some garbage in "cannot \read from terminal"/"End of file on the terminal!" error

Hironori KITAGAWA h_kitagawa2001 at yahoo.co.jp
Sun Jul 18 21:32:22 CEST 2021


Hello all,

Hironobu Yamashita reported the following example,
which shows that some garbage "x ag _" is printed in the log (u.log).
----
$ cat u.tex
\documentclass{zzzz}

\stop
$ echo x | latex u | head -n5
This is pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2022/dev) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
(./u.tex
LaTeX2e <2021-06-01> patch level 1
$ grep '<read \*>' u.log
<read *> x ag _
----

I made a similar example for plain TeX.
----
$ cat v.tex
%#!tex
\def\testB#1{\read-1to\temp\testB\relax\relax}
\testB\relax\relax
$ (for i in `seq 40`; do echo c; done) | tex v
This is TeX, Version 3.141592653 (TeX Live 2021) (preloaded format=tex)
(./v.tex! Emergency stop.
<read *> c^^Mo\temp\testB\rela

... (omitted, "End of file on the terminal!" in the log)
----

Yukimasa Morimi and I looked into these matter, and found that
the variable limit is not initialized when
  else fatal_error("*** (cannot \read from terminal in nonstop modes)")
  (module 484 in tex.web)
and
  if not input_ln(term_in,true) then fatal_error("End of file on the terminal!");
  (module 71 in tex.web)
I made a patch (to tex.ch) which initializes limit in these modules.


Regards
Hironori KITAGAWA
<h_kitagawa2001 at yahoo.co.jp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tex.ch.diff
Type: application/octet-stream
Size: 1008 bytes
Desc: not available
URL: <https://tug.org/pipermail/tex-k/attachments/20210719/d550cd47/attachment.obj>


More information about the tex-k mailing list.