[latex3-commits] [git/LaTeX3-latex3-latex2e] bm-ifnextchar: guard kernel at ifnextchar for issue #554 (bbe63b6c)
David Carlisle
d.p.carlisle at gmail.com
Sun Apr 25 15:05:06 CEST 2021
Repository : https://github.com/latex3/latex2e
On branch : bm-ifnextchar
Link : https://github.com/latex3/latex2e/commit/bbe63b6c12480948abc3586a7c95bfc5222993a1
>---------------------------------------------------------------
commit bbe63b6c12480948abc3586a7c95bfc5222993a1
Author: David Carlisle <d.p.carlisle at gmail.com>
Date: Sun Apr 25 14:05:06 2021 +0100
guard kernel at ifnextchar for issue #554
>---------------------------------------------------------------
bbe63b6c12480948abc3586a7c95bfc5222993a1
required/tools/bm.dtx | 5 ++++-
required/tools/changes.txt | 4 ++++
required/tools/testfiles/github-0554.lvt | 30 ++++++++++++++++++++++++++++++
required/tools/testfiles/github-0554.tlg | 16 ++++++++++++++++
4 files changed, 54 insertions(+), 1 deletion(-)
diff --git a/required/tools/bm.dtx b/required/tools/bm.dtx
index 80c73f57..1c92b68a 100644
--- a/required/tools/bm.dtx
+++ b/required/tools/bm.dtx
@@ -36,7 +36,7 @@
%<driver>\ProvidesFile{bm.drv}
% \fi
% \ProvidesFile{bm.dtx}
- [2019/07/24 v1.2d Bold Symbol Support (DPC/FMi)]
+ [2021/04/25 v1.2e Bold Symbol Support (DPC/FMi)]
%
% \iffalse
%<*driver>
@@ -781,6 +781,8 @@
% you put something really strange in the arguments.
% \changes{v0.11}{1997/01/06}
% {\cs{@ifnextchar} made safe.}
+% \changes{v1.2e}{2021/04/25}
+% {tread \cs{kernel at ifnextchar} like \cs{@ifnextchar}}
% \begin{macrocode}
\def\@ifnextchar##1##2##3##4{%
\if##1##4%
@@ -789,6 +791,7 @@
\expandafter\@secondoftwo
\fi
{##2##4}{##3{##4}}}%
+ \let\kernel at ifnextchar\@ifnextchar
% \end{macrocode}
% For Vladimir Volovich\ldots
% \changes{v1.0f}{1998/12/10}
diff --git a/required/tools/changes.txt b/required/tools/changes.txt
index f13348f7..22932faa 100644
--- a/required/tools/changes.txt
+++ b/required/tools/changes.txt
@@ -6,6 +6,10 @@ completeness or accuracy and it contains some references to files that
are not part of the distribution.
=======================================================================
+2021-04-25 David Carlisle <David.Carlisle at latex-project.org>
+
+ * bm.dtx: guard \kernel at ifnextchar (gh/554)
+
2021-04-21 David Carlisle <David.Carlisle at latex-project.org>
* longtable.dtx: make \\ robust (gh/548)
diff --git a/required/tools/testfiles/github-0554.lvt b/required/tools/testfiles/github-0554.lvt
new file mode 100644
index 00000000..62c49cac
--- /dev/null
+++ b/required/tools/testfiles/github-0554.lvt
@@ -0,0 +1,30 @@
+
+% bm should guard \kernel at ifnextchar as well as \@ifnextchar
+% github issue 554
+
+\documentclass{article}
+
+\makeatletter
+\let\test at end\@@end % end games in test2e and bm.sty conflict
+
+\usepackage{bm}
+\input{test2e}
+
+\newcommand{\myfuncA}[0]{A}
+\newcommand{\myfuncB}[1]{#1}
+\newcommand{\myfuncC}[1][]{#1}
+
+\begin{document}
+
+\sbox0{
+\let\@@end\test at end
+$
+ \bm{\myfuncA} % works
+ \bm{\myfuncB{B}} % works
+ \textbf{\myfuncC[C]} % works
+ \bm{\myfuncC[C]} % doesn't work
+ $}
+\START
+% this should end with a bold math italic C (not an internal parse error)
+ \showbox0
+\END
diff --git a/required/tools/testfiles/github-0554.tlg b/required/tools/testfiles/github-0554.tlg
new file mode 100644
index 00000000..7bf6a68e
--- /dev/null
+++ b/required/tools/testfiles/github-0554.tlg
@@ -0,0 +1,16 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+> \box...=
+\hbox(6.86111+0.0)x38.34807
+.\glue 3.33333 plus 1.66666 minus 1.11111
+.\mathon
+.\OML/cmm/b/it/10 A
+.\OML/cmm/b/it/10 B
+.\kern0.48349
+.\hbox(6.86111+0.0)x8.30551
+..\OT1/cmr/bx/n/10 C
+.\OML/cmm/b/it/10 C
+.\kern0.6979
+.\mathoff
+! OK.
+l. ... \showbox0
More information about the latex3-commits
mailing list.