[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: texinfo: texi2dvi doesn't protect the ~ character in the second pass



For your convenience, my commentary on why I cloned bug 822227 and
reassigned the clone to the texinfo package.  (Quoted from the bug
report)

	       	     	      - Ted

OK, I see what is going on.  This is a bug in texi2dvi in the "local"
build-mode.  When you use --clean, this uses the "tidy" mode, where
all of the aux files end up in a libext2fs.t2d directory, and in this
mode texi2dvi doesn't omit protecting the filename using the catcode
hack --- which in fact texi2dvi has support for, but due to a logic
bug in catcode_special variable, this gets erroneously set to false
the second time it is run.  The net result is that the second time tex
is run, the ~ character isn't properly protected in local mode.

I don't mind working around the bug using texi2dvi --clean in
e2fsprogs, but this is technically a bug in the texinfo package, where
they need to apply the following patch:

--- /usr/bin/texi2dvi	2016-03-05 09:37:09.000000000 -0500
+++ /tmp/texi2dvi	2016-04-24 20:00:49.866328157 -0400
@@ -812,7 +812,7 @@
 
   # do the special catcode trick for ~ in filenames only for Texinfo,
   # not LaTeX.
-  if test x"$in_lang" = xtexinfo && test $catcode_special = maybe; then
+  if test x"$in_lang" = xtexinfo && test $catcode_special != false ; then
     catcode_special=true
   else
     catcode_special=false


texinfo maintainers --- this bug can be reproduced by creating a
pathname to a texinfo file with a ~ in it, and then running texi2dvi
on it.  For example:

% cd /tmp
% rm libext2fs.*
% texi2dvi /tmp/e2fsprogs-1.43~WIP.2016.03.15/doc/libext2fs.texinfo

and you will get:

This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=etex)
 restricted \write18 enabled.
entering extended mode
! I can't find file `/tmp/e2fsprogs-1.43'.
<to be read again> 
                   \penalty 
~->\penalty 
            \@M \ 
<*> \input /tmp/e2fsprogs-1.43~
                               WIP.2016.03.15/doc/libext2fs.texinfo
(Press Enter to retry, or Control-D to exit)
Please type another input file name: 


The patch above will fix the failure.

						- Ted


Reply to: