[latex3-commits] [git/LaTeX3-latex3-latex2e] gh481: tests and update for issue #481 (05430a5c)
David Carlisle
d.p.carlisle at gmail.com
Sun Jan 31 18:51:49 CET 2021
Repository : https://github.com/latex3/latex2e
On branch : gh481
Link : https://github.com/latex3/latex2e/commit/05430a5c373733039bdf36a51ca7faf60471e6a6
>---------------------------------------------------------------
commit 05430a5c373733039bdf36a51ca7faf60471e6a6
Author: David Carlisle <d.p.carlisle at gmail.com>
Date: Sun Jan 31 17:51:49 2021 +0000
tests and update for issue #481
>---------------------------------------------------------------
05430a5c373733039bdf36a51ca7faf60471e6a6
base/changes.txt | 5 ++++
base/ltfilehook.dtx | 30 +++++++++++++++++++---
base/testfiles/github-0481.lvt | 17 ++++++++++++
.../{github-0060.xetex.tlg => github-0481.tlg} | 2 ++
4 files changed, 51 insertions(+), 3 deletions(-)
diff --git a/base/changes.txt b/base/changes.txt
index 1259b9f6..0703995f 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,11 @@ completeness or accuracy and it contains some references to files that
are not part of the distribution.
================================================================================
+2021-01-31 David Carlisle <David.Carlisle at latex-project.org>
+
+ * ltfilehook.dtx: set \protect to \string to avoid bad
+ expansion and possible non termination. github/481
+
2021-01-22 Marcel Krüger <Marcel.Krueger at latex-project.org>
* ltshipout.dtx:
diff --git a/base/ltfilehook.dtx b/base/ltfilehook.dtx
index 9f860458..1a36e606 100644
--- a/base/ltfilehook.dtx
+++ b/base/ltfilehook.dtx
@@ -31,8 +31,8 @@
%%% From File: ltfilehook.dtx
%
% \begin{macrocode}
-\providecommand\ltfilehookversion{v1.0e}
-\providecommand\ltfilehookdate{2021/01/07}
+\providecommand\ltfilehookversion{v1.0ef}
+\providecommand\ltfilehookdate{2021/01/31}
% \end{macrocode}
%
%<*driver>
@@ -999,6 +999,7 @@
% \subsection{Selecting a file (\cs{set at curr@file})}
%
% \begin{macro}{\set at curr@file,\@curr at file,\@curr at file@reqd}
+% \changes{v1.0f}{2021/01/31}{set \cs{protect} to \cs{string} gh/481}
% Now we hook into \cs{set at curr@file} to resolve a possible file
% substitution, and add \cs{@expl@@@filehook at set@curr at file@@nNN}
% at the end, after \cs{@curr at file} is set.
@@ -1022,11 +1023,12 @@
% \begin{macrocode}
%</2ekernel>
%<*2ekernel|latexrelease>
-%<latexrelease>\IncludeInRelease{2020/10/01}%
+%<latexrelease>\IncludeInRelease{2021/05/01}%
%<latexrelease> {\set at curr@file}{Setting current file name}%
\def\set at curr@file#1{%
\begingroup
\escapechar\m at ne
+ \let\protect\string
\expandafter\def\csname\expandafter\endcsname
\expandafter{\csname\endcsname}%
% \end{macrocode}
@@ -1064,6 +1066,28 @@
% \end{macrocode}
%
% \begin{macrocode}
+%<latexrelease>\IncludeInRelease{2020/10/01}%
+%<latexrelease>\def\set at curr@file#1{%
+%<latexrelease> \begingroup
+%<latexrelease> \escapechar\m at ne
+%<latexrelease> \expandafter\def\csname\expandafter\endcsname
+%<latexrelease> \expandafter{\csname\endcsname}%
+%<latexrelease> \@expl@@@filehook at if@no at extension@@nTF{#1}%
+%<latexrelease> {\@tempswatrue}{\@tempswafalse}%
+%<latexrelease> \@kernel at make@file at csname\@curr at file
+%<latexrelease> \@expl@@@filehook at resolve@file at subst@@w {#1}%
+%<latexrelease> \@expl@@@filehook at if@file at replaced@@TF
+%<latexrelease> {\@kernel at make@file at csname\@curr at file@reqd
+%<latexrelease> \@expl@@@filehook at normalize@file at name@@w{#1}%
+%<latexrelease> \if at tempswa \@expl@@@filehook at drop@extension@@N\@curr at file@reqd \fi}%
+%<latexrelease> {\if at tempswa \@expl@@@filehook at drop@extension@@N\@curr at file \fi
+%<latexrelease> \global\let\@curr at file@reqd\@curr at file}%
+%<latexrelease> \@expl@@@filehook at clear@replacement at flag@@
+%<latexrelease> \endgroup}
+%<latexrelease>\EndIncludeInRelease
+% \end{macrocode}
+%
+% \begin{macrocode}
%<latexrelease>\IncludeInRelease{2019/10/01}%
%<latexrelease> {\set at curr@file}{Setting current file name}%
%<latexrelease>\def\set at curr@file#1{%
diff --git a/base/testfiles/github-0481.lvt b/base/testfiles/github-0481.lvt
new file mode 100644
index 00000000..6ead169a
--- /dev/null
+++ b/base/testfiles/github-0481.lvt
@@ -0,0 +1,17 @@
+\documentclass{article}
+\input{test2e}
+\makeatletter
+\begin{document}
+
+\START
+% non termination before 2021
+% now sqrt {2}.tex
+\set at curr@file{\sqrt{2}}
+\typeout{\meaning\@curr at file}
+
+% filename protect{begingroup1endgroupover2}.tex before 2021
+% now frac {1}{2}.tex
+\set at curr@file{\frac{1}{2}}
+\typeout{\meaning\@curr at file}
+
+\END
diff --git a/base/testfiles/github-0060.xetex.tlg b/base/testfiles/github-0481.tlg
similarity index 72%
copy from base/testfiles/github-0060.xetex.tlg
copy to base/testfiles/github-0481.tlg
index 1d0c6975..b131cab6 100644
--- a/base/testfiles/github-0060.xetex.tlg
+++ b/base/testfiles/github-0481.tlg
@@ -1,2 +1,4 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
+macro:->sqrt {2}
+macro:->frac {1}{2}
More information about the latex3-commits
mailing list.