From e5eb637929530ade80eb06166f5c9bf94520cc8a Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Thu, 3 Oct 2013 17:13:21 +0000
Subject: eplain (1oct13)

git-svn-id: svn://tug.org/texlive/trunk@31819 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/eplain/btxmac.tex | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

(limited to 'Master/texmf-dist/tex/eplain/btxmac.tex')

diff --git a/Master/texmf-dist/tex/eplain/btxmac.tex b/Master/texmf-dist/tex/eplain/btxmac.tex
index 88338ab8b39..2507dae85f3 100644
--- a/Master/texmf-dist/tex/eplain/btxmac.tex
+++ b/Master/texmf-dist/tex/eplain/btxmac.tex
@@ -1,7 +1,7 @@
 %% @texfile{
 %%   author = "Karl Berry and Oren Patashnik",
-%%   version = "0.99m",
-%%   date = "7 February 2013",
+%%   version = "0.99n",
+%%   date = "30 September 2013",
 %%   filename = "btxmac.tex",
 %%   address = "tex-eplain@tug.org",
 %%   supported = "yes",
@@ -299,7 +299,7 @@
 % essentially like \futurelet except that it discards any implicit or
 % explicit space tokens that intervene before a nonspace is scanned:
 %
-\def\@futurenonspacelet#1{\def\cs{#1}%
+\long\def\@futurenonspacelet#1{\def\cs{#1}%
    \afterassignment\@stepone\let\@nexttoken=
 }%
 \begingroup % The grouping here avoids stepping on an outside use of `\\'.
@@ -319,7 +319,7 @@
 % the brackets don't have a funny category code.
 %
 \def\@getoptionalarg#1{%
-   \let\@optionaltemp = #1%
+   \let\@optionalusercs = #1%
    \let\@optionalnext = \relax
    \@futurenonspacelet\@optionalnext\@bracketcheck
 }%
@@ -329,19 +329,21 @@
 %
 \def\@bracketcheck{%
    \ifx [\@optionalnext
-      \expandafter\@@getoptionalarg
+      \expandafter\@@getoptionalarg % we have an optional arg
    \else
-      \let\@optionalarg = \empty
-      % We can't do the \temp after the \fi, because then the \temp gets
-      % in the way of reading the optional argument from the input, if
-      % we do have one.
-      \expandafter\@optionaltemp
+      \let\@optionalarg = \empty    % no optional arg
+      \expandafter\@optionalusercs
    \fi
 }%
 %
+% Get the next bracketed text.
 \def\@@getoptionalarg[#1]{%
    \def\@optionalarg{#1}%
-   \@optionaltemp
+   % Ignore spaces after the optional arg, too.
+   % (We don't actually need to peek ahead, but this is the easiest way
+   % to ignore the spaces.)
+   \let\@optdummy=\relax % just in case it has become \outer somehow
+   \@futurenonspacelet\@optdummy\@optionalusercs
 }%
 %
 %
-- 
cgit v1.2.3

