From f230bae8f263f753df0d1f04a2d57a5ef1fd9b80 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Fri, 28 Feb 2020 22:28:01 +0000
Subject: latex (28feb20)

git-svn-id: svn://tug.org/texlive/trunk@53958 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/base/latexrelease.sty | 30 ++++++++++++++++++-----
 1 file changed, 24 insertions(+), 6 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/base/latexrelease.sty')

diff --git a/Master/texmf-dist/tex/latex/base/latexrelease.sty b/Master/texmf-dist/tex/latex/base/latexrelease.sty
index 11e6ea016af..353f2aa7c5f 100644
--- a/Master/texmf-dist/tex/latex/base/latexrelease.sty
+++ b/Master/texmf-dist/tex/latex/base/latexrelease.sty
@@ -4816,11 +4816,16 @@ of this package available from CTAN}
    \expandafter\ifx\csname #1+#2\endcsname\relax
      \@latex@error{Font family `#1+#2' unknown}\@eha
    \else
+     \edef\reserved@a{#3}%
+     \expandafter\series@maybe@drop@one@m\expandafter{#3}\reserved@b
+     \ifx\reserved@a\reserved@b\else
+       \@latex@warning{Font shape declaration has incorrect series
+         value `#3'.\MessageBreak It should not contain an `m'!
+         Please correct it.\MessageBreak Found}%
+     \fi
      \expandafter
-       \xdef\csname#1/#2/%
-       \expandafter\series@drop@one@m #3mm\series@drop@one@m/%
-       #4\endcsname{\expandafter\noexpand
-                                   \csname #5\endcsname}%
+       \xdef\csname#1/#2/\reserved@b/#4\endcsname
+                 {\expandafter\noexpand\csname #5\endcsname}%
      \def\reserved@a{#6}%
      \global
      \expandafter\let\csname#5\expandafter\endcsname
@@ -5538,10 +5543,22 @@ of this package available from CTAN}
 \DeclareFontSeriesChangeRule {m}{sc}{msc}{mc}
 \def\set@target@series#1{%
     \edef\f@series{#1}%
-    \edef\f@series{\expandafter\series@drop@one@m\f@series mm\series@drop@one@m}%
+    \expandafter\series@maybe@drop@one@m\expandafter{\f@series}\f@series
+}
+\def\series@maybe@drop@one@m#1#2{%
+  \def\in@@##1,#1,{}%
+  \series@check@toks\expandafter{\in@@
+    ,ulm,elm,lm,slm,mm,sbm,bm,ebm,ubm,muc,mec,mc,msc,msx,mx,mex,mux,{}{},#1,}%
+  \edef\in@@{\the\series@check@toks}%
+  \ifx\in@@\@empty
+    \def#2{#1}%
+  \else
+    \edef#2{\expandafter\series@drop@one@m #1m\series@drop@one@m}%
+  \fi
 }
+\newtoks\series@check@toks
 \def\series@drop@one@m#1m#2m#3\series@drop@one@m{%
-  \ifx\relax#1#2\relax m\else#1#2\fi
+   #1#2%
 }
 
 \def\DeclareFontShapeChangeRule #1#2#3#4{%
@@ -5667,6 +5684,7 @@ of this package available from CTAN}
 \let\@font@shape@subst@warning\@undefined
 \let\maybe@load@fontshape\@undefined
 \let\set@target@series\@undefined
+\let\series@maybe@drop@one@m\@undefined
 \let\series@drop@one@m\@undefined
 \let\DeclareFontShapeChangeRule\@undefined
 \let\merge@font@shape\@undefined
-- 
cgit v1.2.3

