[latex3-commits] [git/LaTeX3-latex3-latex2e] master: fix for issue #109 (d55d66a)

Frank Mittelbach frank.mittelbach at latex-project.org
Thu Feb 7 10:12:56 CET 2019


Repository : https://github.com/latex3/latex2e
On branch  : master
Link       : https://github.com/latex3/latex2e/commit/d55d66a6bd494d3aa4b5abc6d768bb1e3b1585f7

>---------------------------------------------------------------

commit d55d66a6bd494d3aa4b5abc6d768bb1e3b1585f7
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Thu Feb 7 10:12:56 2019 +0100

    fix for issue #109


>---------------------------------------------------------------

d55d66a6bd494d3aa4b5abc6d768bb1e3b1585f7
 base/changes.txt                                |    5 +++++
 base/ltfiles.dtx                                |   12 ++++++++++--
 base/testfiles/github-0109.lvt                  |   16 ++++++++++++++++
 base/testfiles/{tlb1873.tlg => github-0109.tlg} |    6 ++++--
 4 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index e77592e..40e73d8 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -4,6 +4,11 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 =======================================================================
 
+2019-02-07  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* ltfiles.dtx (subsection{Safe Input Macros}):
+	Expand \@filef at und before executing second argument (github/109)
+
 2019-02-06  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* utf8ienc.dtx (subsection{The mapping table}):
diff --git a/base/ltfiles.dtx b/base/ltfiles.dtx
index 6960fd4..cbe6bfe 100644
--- a/base/ltfiles.dtx
+++ b/base/ltfiles.dtx
@@ -32,7 +32,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltfiles.dtx}
-             [2018/01/08 v1.1m LaTeX Kernel (File Handling)]
+             [2019/02/07 v1.1n LaTeX Kernel (File Handling)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltfiles.dtx}
@@ -718,10 +718,18 @@
 % If the file |#1| does not exist, execute `|#3|'.
 % \changes{v1.0t}{1995/05/25}
 %         {(CAR) added \cs{long}}
+% \changes{v1.1n}{2019/02/07}{Expand \cs{@filef at und} before executing
+%   second argument (github/109)}
 %    \begin{macrocode}
 \long\def \InputIfFileExists#1#2{%
   \IfFileExists{#1}%
-    {#2\@addtofilelist{#1}\@@input \@filef at und}}
+    {%
+  \expandafter\swap at args\expandafter
+      {\@filef at und}{#2\@addtofilelist{#1}\@@input}}}
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
+\long\def\swap at args#1#2{#2#1}
 %    \end{macrocode}
 %  \end{macro}
 %
diff --git a/base/testfiles/github-0109.lvt b/base/testfiles/github-0109.lvt
new file mode 100644
index 0000000..87ee267
--- /dev/null
+++ b/base/testfiles/github-0109.lvt
@@ -0,0 +1,16 @@
+\begin{filecontents}{\jobname-1}
+\typeout{file 1}
+\end{filecontents}
+\begin{filecontents}{\jobname-2}
+\typeout{file 2}
+\end{filecontents}
+
+\input{test2e}
+
+\START
+
+\InputIfFileExists{\jobname-1}{\input{\jobname-2}\par}{\message{No \jobname-1.}\par}
+
+\END
+
+
diff --git a/base/testfiles/tlb1873.tlg b/base/testfiles/github-0109.tlg
similarity index 65%
copy from base/testfiles/tlb1873.tlg
copy to base/testfiles/github-0109.tlg
index 348b2a2..bdde228 100644
--- a/base/testfiles/tlb1873.tlg
+++ b/base/testfiles/github-0109.tlg
@@ -1,5 +1,7 @@
 This is a generated file for the LaTeX2e validation system.
 Don't change this file in any respect.
-(tlb1873a.sty (tlb1873b.sty)
-optionA
+(github-0109-2.tex
+file 2
+) (github-0109-1.tex
+file 1
 )





More information about the latex3-commits mailing list