summaryrefslogtreecommitdiff
path: root/macros/latex-dev/base/docstrip.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex-dev/base/docstrip.dtx')
-rw-r--r--macros/latex-dev/base/docstrip.dtx23
1 files changed, 20 insertions, 3 deletions
diff --git a/macros/latex-dev/base/docstrip.dtx b/macros/latex-dev/base/docstrip.dtx
index 9cc7945d60..3ce6ed5696 100644
--- a/macros/latex-dev/base/docstrip.dtx
+++ b/macros/latex-dev/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}
%%
%
@@ -1635,6 +1635,16 @@ Z
\x
% \end{macrocode}
%
+% \begin{macro}{\quote@name}
+% \changes{v2.5h}{2020/04/18}{Macro added gfh/221)}
+% A macro copied from \texttt{ltfiles.dtx} in order to be able to
+% allow spaces in filenames.
+% \begin{macrocode}
+\def\quote@name#1{"\quote@@name#1\@gobble""}
+\def\quote@@name#1"{#1\quote@@name}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\StreamOpen}\begin{macro}{\StreamPut}
% \begin{macro}{\StreamClose}
% Here is stream opening operator. Its parameter should be a macro
@@ -1642,6 +1652,10 @@ 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)}
+% \changes{v2.5h}{2020/04/18}{Added two times two \cs{expandafters} to
+% make the case with a filename in quotes work as well}
% \begin{macrocode}
\chardef\stream@closed=16
\def\StreamOpen#1{%
@@ -1649,7 +1663,10 @@ Z
\def\s@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@curr@file{%
+ \expandafter\expandafter\expandafter\quote@name
+ \expandafter\expandafter\expandafter{\csname pth@\@stripstring#1\endcsname}}
+ \immediate\openout#1=\q@curr@file\relax
\@streamfound
\fi}
\@outputstreams