[latex3-commits] [git/LaTeX3-latex3-latex2e] gh221: Enclose the filename in the argument to \openout in quotes (2901e5bc)

Johannes Braams texniek at braams.xs4all.nl
Sat Apr 18 00:22:32 CEST 2020


Repository : https://github.com/latex3/latex2e
On branch  : gh221
Link       : https://github.com/latex3/latex2e/commit/2901e5bcf12314a9eebc2e9cc0551eeadaba19a5

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

commit 2901e5bcf12314a9eebc2e9cc0551eeadaba19a5
Author: Johannes Braams <texniek at braams.xs4all.nl>
Date:   Sat Apr 18 00:22:32 2020 +0200

    Enclose the filename in the argument to \openout in quotes


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

2901e5bcf12314a9eebc2e9cc0551eeadaba19a5
 base/docstrip.dtx | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/base/docstrip.dtx b/base/docstrip.dtx
index 9cc7945d..2653e820 100644
--- a/base/docstrip.dtx
+++ b/base/docstrip.dtx
@@ -29,8 +29,8 @@
 \catcode`\{=1
 \catcode`\}=2
 \def\filename{docstrip.dtx}
-\def\fileversion{2.5g}
-\def\filedate{2018/05/03}
+\def\fileversion{v2.5h}
+\def\filedate{2020/04/18}
 \def\docdate {2018/05/03}
 %%
 %
@@ -1642,6 +1642,8 @@ Z
 % write to file |foo.tex|   use    |\StreamOpen\foo|,    then
 % |\StreamPut\foo|    and |\StreamClose\foo|.
 %
+% \changes{v2.5h}{2020/04/18}{Allow spaces in filenames by enclosing
+%    them in quotes (gh/221)}
 %    \begin{macrocode}
 \chardef\stream at closed=16
 \def\StreamOpen#1{%
@@ -1649,7 +1651,10 @@ Z
   \def\s at do##1{\ifnum##1=0
     \chardef#1=\expandafter\@stripstr\string##1 %
     \global\chardef##1=1 %
-    \immediate\openout#1=\csname pth@\@stripstring#1\endcsname %
+    \edef\q at curr@file{%
+      \expandafter\quote at name
+      \expandafter{\csname pth@\@stripstring#1\endcsname}}
+    \immediate\openout#1=\q at curr@file\relax
     \@streamfound
     \fi}
   \@outputstreams





More information about the latex3-commits mailing list.