[tex-live] bug with \input

Olaf Weber olaf at infovore.xs4all.nl
Wed Jun 16 11:27:03 CEST 2004


Werner LEMBERG writes:

> [P4 2004-06-16 07:49 MEST]

> Running this command

>   VARTEXMF=/home/foo/texmf-var \
>   PATH=/home/bar/TeXLive/TeXLive/bin/i386-linux:$PATH \
>   latex cjk.tex

> on this

>   \documentclass{article}
>   \usepackage{CJK}
>   \begin{document}
>   \begin{CJK}{GB}{gbsn}
>   ^^ce^^ce
>   \end{CJK}
>   \end{document}

> gives the following error message:

>   ! I can't find file `CJK.en'.
>   l.462 \input CJK.enc
                    
>   Please type another input file name:

> After manually entering `CJK.enc' compilation succeeds.  The same
> happens with pdflatex.

> This looks like a serious bug.

It is related to the spaces-in-filenames code (of course).  What
happens is that code that keeps TeX from going beyond the end of the
buffer when filenames are quoted misfires.  That particular bit of
code is there to provide some sanity in cases where the quotes are
unbalanced.

$ cvs diff -u tex.ch
Index: tex.ch
===================================================================
RCS file: /usr/local/cvsroot/texk/texk/web2c/tex.ch,v
retrieving revision 1.75
diff -u -r1.75 tex.ch
--- tex.ch      13 Jun 2004 15:33:04 -0000      1.75
+++ tex.ch      16 Jun 2004 09:25:18 -0000
@@ -2250,8 +2250,11 @@
 @x [29.526] l.10194 - stop scanning file name if we're at end-of-line.
   if not more_name(cur_chr) then goto done;
 @y
-  if ((state<>token_list) and (loc>limit)) or not more_name(cur_chr) then
-    goto done;
+  {If |cur_chr| is a space and we're not scanning a token list, check
+   whether we're at the end of the buffer. Otherwise we end up adding
+   spurious spaces to file names in some cases.}
+  if (cur_chr=" ") and (state<>token_list) and (loc>limit) then goto done;
+  if not more_name(cur_chr) then goto done;
 @z

 @x [29.530] l.10239 - prompt_file_name: No default extension is TeX input file.

-- 
Olaf Weber

               (This space left blank for technical reasons.)



More information about the tex-live mailing list