[latex3-commits] [git/LaTeX3-latex3-latex2e] gh963: Better not leave side effects if not defining (401a6215)
PhelypeOleinik
phelype.oleinik at latex-project.org
Mon Nov 28 05:43:33 CET 2022
Repository : https://github.com/latex3/latex2e
On branch : gh963
Link : https://github.com/latex3/latex2e/commit/401a621546946359f1df95a1335c8a3739208008
>---------------------------------------------------------------
commit 401a621546946359f1df95a1335c8a3739208008
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date: Mon Nov 28 01:43:33 2022 -0300
Better not leave side effects if not defining
>---------------------------------------------------------------
401a621546946359f1df95a1335c8a3739208008
base/ltdefns.dtx | 7 +++----
base/testfiles-ltcmd/github-0963.tlg | 2 +-
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/base/ltdefns.dtx b/base/ltdefns.dtx
index d2ffc578..7f3fa140 100644
--- a/base/ltdefns.dtx
+++ b/base/ltdefns.dtx
@@ -1733,11 +1733,10 @@
{\@firstofone}%
{\@firstofone}}
\long\def\declare at environmentcopy#1#2#3#4{%
- \def\reserved at a{#3}%
+ \edef\reserved at a{\@ifundefined{#3}{end#3}{#3}}%
\@ifundefined\reserved at a
- {\expandafter\let\csname #3\expandafter\endcsname
- \csname end#3\endcsname}{}%
- \@ifundefined\reserved at a{#1}{#2}%
+ {\def\reserved at a{#3}#1}%
+ {\def\reserved at a{#3}#2}%
{\ExpandArgs{cc}\declare at commandcopy@do{#3}{#4}%
\ExpandArgs{cc}\declare at commandcopy@do{end#3}{end#4}}}
% \end{macrocode}
diff --git a/base/testfiles-ltcmd/github-0963.tlg b/base/testfiles-ltcmd/github-0963.tlg
index 5c8256cc..77016a91 100644
--- a/base/testfiles-ltcmd/github-0963.tlg
+++ b/base/testfiles-ltcmd/github-0963.tlg
@@ -67,7 +67,7 @@ l. ...\NewEnvironmentCopy{group}{foo}
Your command was ignored.
Type I <command> <return> to replace it with another command,
or <return> to continue without it.
-> \group=\endgroup.
+> \group=undefined.
l. ...\show\group
> \endgroup=\endgroup.
l. ...\show\endgroup
More information about the latex3-commits
mailing list.