From 3c9b5c2960ae2455180bdb3a4e67bf10175b39af Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Tue, 12 Apr 2011 22:56:39 +0000
Subject: oberdiek (12apr11)

git-svn-id: svn://tug.org/texlive/trunk@22061 c570f23f-e606-0410-a88d-b1316a301751
---
 .../source/latex/oberdiek/rerunfilecheck.dtx       | 81 +++++++++++++++-------
 1 file changed, 55 insertions(+), 26 deletions(-)

(limited to 'Master/texmf-dist/source/latex/oberdiek/rerunfilecheck.dtx')

diff --git a/Master/texmf-dist/source/latex/oberdiek/rerunfilecheck.dtx b/Master/texmf-dist/source/latex/oberdiek/rerunfilecheck.dtx
index b64d34f38f9..4b9fb4e1ff0 100644
--- a/Master/texmf-dist/source/latex/oberdiek/rerunfilecheck.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/rerunfilecheck.dtx
@@ -162,7 +162,7 @@ and the derived files
 %</driver>
 % \fi
 %
-% \CheckSum{545}
+% \CheckSum{601}
 %
 % \CharacterTable
 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -309,28 +309,37 @@ and the derived files
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\begingroup
-  \catcode123 1 % {
-  \catcode125 2 % }
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+  \catcode13=5 % ^^M
+  \endlinechar=13 %
+  \catcode123=1 % {
+  \catcode125=2 % }
+  \catcode64=11 % @
   \def\x{\endgroup
     \expandafter\edef\csname ReFiCh@AtEnd\endcsname{%
-      \catcode35 \the\catcode35\relax
-      \catcode64 \the\catcode64\relax
-      \catcode123 \the\catcode123\relax
-      \catcode125 \the\catcode125\relax
+      \endlinechar=\the\endlinechar\relax
+      \catcode13=\the\catcode13\relax
+      \catcode32=\the\catcode32\relax
+      \catcode35=\the\catcode35\relax
+      \catcode61=\the\catcode61\relax
+      \catcode64=\the\catcode64\relax
+      \catcode123=\the\catcode123\relax
+      \catcode125=\the\catcode125\relax
     }%
   }%
-\x
-\catcode35 6 % #
-\catcode64 11 % @
-\catcode123 1 % {
-\catcode125 2 % }
+\x\catcode61\catcode48\catcode32=10\relax%
+\catcode13=5 % ^^M
+\endlinechar=13 %
+\catcode35=6 % #
+\catcode64=11 % @
+\catcode123=1 % {
+\catcode125=2 % }
 \def\TMP@EnsureCode#1#2{%
   \edef\ReFiCh@AtEnd{%
     \ReFiCh@AtEnd
-    \catcode#1 \the\catcode#1\relax
+    \catcode#1=\the\catcode#1\relax
   }%
-  \catcode#1 #2\relax
+  \catcode#1=#2\relax
 }
 \TMP@EnsureCode{39}{12}% '
 \TMP@EnsureCode{40}{12}% (
@@ -342,12 +351,11 @@ and the derived files
 \TMP@EnsureCode{58}{12}% :
 \TMP@EnsureCode{59}{12}% ;
 \TMP@EnsureCode{60}{12}% <
-\TMP@EnsureCode{61}{12}% =
 \TMP@EnsureCode{62}{12}% >
 \TMP@EnsureCode{91}{12}% [
 \TMP@EnsureCode{93}{12}% ]
 \TMP@EnsureCode{96}{12}% `
-\g@addto@macro\ReFiCh@AtEnd{\endinput}
+\edef\ReFiCh@AtEnd{\ReFiCh@AtEnd\noexpand\endinput}
 %    \end{macrocode}
 %
 %    Package identification.
@@ -423,7 +431,7 @@ and the derived files
   \newcommand*{\RerunFileCheck}[3]{}%
   \renewcommand*{\RerunFileCheckSetup}[1]{}%
   \expandafter\ReFiCh@AtEnd
-\fi
+\fi%
 %    \end{macrocode}
 %
 % \subsection{Standard \xext{.aux} files}
@@ -700,7 +708,7 @@ and the derived files
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\ReFiCh@AtEnd
+\ReFiCh@AtEnd%
 %</package>
 %    \end{macrocode}
 %
@@ -767,6 +775,22 @@ and the derived files
     \advance\count@ 1 %
   \repeat
 }
+\def\RangeCatcodeCheck#1#2#3{%
+  \count@=#1\relax
+  \loop
+    \ifnum#3=\catcode\count@
+    \else
+      \errmessage{%
+        Character \the\count@\space
+        with wrong catcode \the\catcode\count@\space
+        instead of \number#3%
+      }%
+    \fi
+  \ifnum\count@<#2\relax
+    \advance\count@ 1 %
+  \repeat
+}
+\def\space{ }
 \expandafter\ifx\csname LoadCommand\endcsname\relax
   \def\LoadCommand{\input rerunfilecheck.sty\relax}%
 \fi
@@ -777,15 +801,20 @@ and the derived files
   \RangeCatcodeInvalid{123}{255}%
   \catcode`\@=12 %
   \catcode`\\=0 %
-  \catcode`\{=1 %
-  \catcode`\}=2 %
-  \catcode`\#=6 %
-  \catcode`\[=12 %
-  \catcode`\]=12 %
   \catcode`\%=14 %
-  \catcode`\ =10 %
-  \catcode13=5 %
   \LoadCommand
+  \RangeCatcodeCheck{0}{36}{15}%
+  \RangeCatcodeCheck{37}{37}{14}%
+  \RangeCatcodeCheck{38}{47}{15}%
+  \RangeCatcodeCheck{48}{57}{12}%
+  \RangeCatcodeCheck{58}{63}{15}%
+  \RangeCatcodeCheck{64}{64}{12}%
+  \RangeCatcodeCheck{65}{90}{11}%
+  \RangeCatcodeCheck{91}{91}{15}%
+  \RangeCatcodeCheck{92}{92}{0}%
+  \RangeCatcodeCheck{93}{96}{15}%
+  \RangeCatcodeCheck{97}{122}{11}%
+  \RangeCatcodeCheck{123}{255}{15}%
   \RestoreCatcodes
 }
 \Test
-- 
cgit v1.2.3

