[latex3-commits] [git/LaTeX3-latex3-latex2e] hotfix/gh422: Make alphabetic characters in \@filelist catcode 11 (5dd39147)
PhelypeOleinik
phelype.oleinik at latex-project.org
Mon Nov 23 22:04:30 CET 2020
Repository : https://github.com/latex3/latex2e
On branch : hotfix/gh422
Link : https://github.com/latex3/latex2e/commit/5dd391479f2df699ef562d46e0c77116c1f9ab28
>---------------------------------------------------------------
commit 5dd391479f2df699ef562d46e0c77116c1f9ab28
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date: Mon Nov 23 18:04:30 2020 -0300
Make alphabetic characters in \@filelist catcode 11
>---------------------------------------------------------------
5dd391479f2df699ef562d46e0c77116c1f9ab28
base/ltfilehook.dtx | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/base/ltfilehook.dtx b/base/ltfilehook.dtx
index 584aa9ff..a2da6c91 100644
--- a/base/ltfilehook.dtx
+++ b/base/ltfilehook.dtx
@@ -712,9 +712,28 @@
}
% \end{macrocode}
%
+% Before adding to the file list we need to make all (letter) characters
+% catcode~11, because several packages use constructions like
+% \begin{verbatim}
+% \filename at parse{<filename>}
+% \ifx\filename at ext\@clsextension
+% ...
+% \fi
+% \end{verbatim}
+% and that doesn't work if \cs{filename at ext} is \cs{detokenize}d.
+% Making \cs{@clsextension} a string doesn't help much because some
+% packages define their own \cs[no-index]{<prefix>@someextension} with
+% normal catcodes. This is not entirely correct because packages loaded
+% (somehow) with catcode~12 alphabetic tokens (say, as the result of
+% a \cs{string} or \cs{detokenize} command, or from a \TeX{} string like
+% \cs{jobname}) will have these character tokens incorrectly turned into
+% letter tokens. This however is rare, so we'll go for the all-letters
+% approach (grepping the packages in \TeX{} Live didn't bring up any
+% obvious candidate for breaking with this catcode change).
% \begin{macrocode}
\def\@input at file@exists at with@hooks#1{%
- \@addtofilelist{\unqu at tefilef@und#1\@nil}%
+ \edef\reserved at a{\unqu at tefilef@und#1\@nil}%
+ \@addtofilelist{\string at makeletter\reserved at a}%
\UseHook{file/before}%
% \end{macrocode}
% The current file name is available in \cs{CurrentFile} so we use
More information about the latex3-commits
mailing list.