summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/oberdiek/catchfile.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/oberdiek/catchfile.sty')
-rw-r--r--Master/texmf-dist/tex/generic/oberdiek/catchfile.sty35
1 files changed, 30 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/generic/oberdiek/catchfile.sty b/Master/texmf-dist/tex/generic/oberdiek/catchfile.sty
index 4706c3f9349..e98547785c6 100644
--- a/Master/texmf-dist/tex/generic/oberdiek/catchfile.sty
+++ b/Master/texmf-dist/tex/generic/oberdiek/catchfile.sty
@@ -94,7 +94,7 @@
\fi
\expandafter\x\csname ver@catchfile.sty\endcsname
\ProvidesPackage{catchfile}%
- [2010/04/08 v1.4 Catches the contents of a file (HO)]
+ [2010/04/28 v1.5 Catches the contents of a file (HO)]
\begingroup
\catcode123 1 % {
\catcode125 2 % }
@@ -128,8 +128,10 @@
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname RequirePackage\endcsname\relax
\input infwarerr.sty\relax
+ \input ltxcmds.sty\relax
\else
\RequirePackage{infwarerr}[2007/09/09]%
+ \RequirePackage{ltxcmds}[2010/03/09]%
\fi
\begingroup
\escapechar=92\relax
@@ -219,6 +221,11 @@
File `#2' not found%
}\@ehc
}
+\ltx@IfUndefined{RequirePackage}{%
+ \input etexcmds.sty\relax
+}{%
+ \RequirePackage{etexcmds}[2010/01/28]%
+}
\long\def\CatchFileEdef#1#2#3{%
\CatchFile@CheckFileExists{#2}%
\ifx\CatchFile@File\relax
@@ -240,12 +247,30 @@
\begingroup
\everyeof\expandafter{%
\CatchFile@EOF
+ \expandafter\CatchFile@Finish
\noexpand
}%
- \expandafter\long\expandafter\def\expandafter\CatchFile@Do
- \expandafter##\expandafter1\CatchFile@EOF{%
- \endgroup
- \def#1{##1}%
+ \ltx@ifundefined{etex@unexpanded}{%
+ \expandafter\long\expandafter\def\expandafter\CatchFile@Do
+ \expandafter##\expandafter1\CatchFile@EOF{%
+ \toks\ltx@zero{##1}%
+ \xdef\CatchFile@gtemp{\the\toks\ltx@zero}%
+ \def\CatchFile@Finish{%
+ \endgroup
+ \let#1\CatchFile@gtemp
+ \global\let\CatchFile@gtemp\ltx@undefined
+ }%
+ }%
+ }{%
+ \expandafter\long\expandafter\def\expandafter\CatchFile@Do
+ \expandafter##\expandafter1\CatchFile@EOF{%
+ \edef\CatchFile@Finish{%
+ \endgroup
+ \etex@unexpanded{%
+ \edef#1{\etex@unexpanded{##1}}%
+ }%
+ }%
+ }%
}%
#3%
\expandafter\expandafter\expandafter\CatchFile@Do