[latex3-commits] [git/LaTeX3-latex3-latex2e] master: catcode protection (6923c07d)

David Carlisle d.p.carlisle at gmail.com
Thu Oct 17 15:35:11 CEST 2019


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

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

commit 6923c07d855e7e6ac2ea1717ba2bf1f9b45a96f0
Author: David Carlisle <d.p.carlisle at gmail.com>
Date:   Thu Oct 17 14:35:11 2019 +0100

    catcode protection


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

6923c07d855e7e6ac2ea1717ba2bf1f9b45a96f0
 required/tools/changes.txt  |  4 ++++
 required/tools/shellesc.dtx | 20 +++++++++++++++++---
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/required/tools/changes.txt b/required/tools/changes.txt
index 64b7e470..f5e69751 100644
--- a/required/tools/changes.txt
+++ b/required/tools/changes.txt
@@ -5,6 +5,10 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 =======================================================================
 
+2019-10-17  David Carlisle  <David.Carlisle at latex-project.org>
+
+	* shellesc.dtx: protect against active _ and "
+
 2019-10-13  David Carlisle  <David.Carlisle at latex-project.org>
 
 	* shellesc.dtx: add logging in luatex and \ShellEscapeStatus
diff --git a/required/tools/shellesc.dtx b/required/tools/shellesc.dtx
index 5702c352..ee5675db 100644
--- a/required/tools/shellesc.dtx
+++ b/required/tools/shellesc.dtx
@@ -20,7 +20,7 @@
 %<driver> \ProvidesFile{shellesc.drv}
 % \fi
 %         \ProvidesFile{shellesc.dtx}
-       [2019/10/13 v1.0a unified shell escape interface for LaTeX]
+       [2019/10/17 v1.0b unified shell escape interface for LaTeX]
 %
 % \iffalse
 %<*driver>
@@ -103,6 +103,14 @@
 %<*package>
 %    \end{macrocode}
 %
+% \changes{v1.0b}{2019/10/17}{Catcode protection}
+%    \begin{macrocode}
+\chardef\shellesc at quotecat\catcode`\"
+\chardef\shellesc at underscorecat\catcode`\_
+\@makeother\"
+\@makeother\_
+%    \end{macrocode}
+%
 % \subsection{Status Check}
 %
 %
@@ -232,7 +240,11 @@ if status == nil then
 %
 % Stop at this point if not a recent Lua\TeX.
 %    \begin{macrocode}
-\ifx\lastsavedimageresourcepages\@undefined\expandafter\endinput\fi
+\ifx\lastsavedimageresourcepages\@undefined
+ \catcode`\"\shellesc at quotecat
+ \catcode`\_\shellesc at underscorecat
+ \expandafter\endinput
+\fi
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -276,7 +288,9 @@ shellesc.write_or_execute=write_or_execute
 \protected\def\write{\directlua{shellesc.write_or_execute()}}
 %    \end{macrocode}
 %
-%
+%    \begin{macrocode}
+\catcode`\"\shellesc at quotecat
+%    \end{macrocode}
 %
 %    \begin{macrocode}
 %</package>





More information about the latex3-commits mailing list