Skip to content

Commit

Permalink
safer test for argument
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcarlisle committed Jan 23, 2025
1 parent 66b9b95 commit 4cc48df
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions base/ltxref.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,14 @@
% \end{macrocode}
% \end{plugdecl}
% \begin{macrocode}
\def\ltx@star@counter{*}
\def\refstepcounter#1{%
\UseSocket{refstepcounter}{%
\stepcounter{#1}%
\edef\@currentcounter{\ifx*#1\@currentcounter\else#1\fi}%
\edef\reserved@a{#1}%
\ifx\reserved@a\ltx@star@counter\else
\let\@currentcounter\reserved@a
\fi
\protected@edef\@currentlabel
% \end{macrocode}
% By generating the second csname first the |\p@...| command can
Expand Down Expand Up @@ -502,7 +506,10 @@
\def\@kernel@refstepcounter#1{%
\UseSocket{refstepcounter}{%
\stepcounter{#1}%
\edef\@currentcounter{#1}%
\edef\reserved@a{#1}%
\ifx\reserved@a\ltx@star@counter\else
\let\@currentcounter\reserved@a
\fi
\protected@edef\@currentlabel
{\csname p@#1\expandafter\endcsname\csname the#1\endcsname}}}%
% \end{macrocode}
Expand Down

0 comments on commit 4cc48df

Please sign in to comment.