=================================================================== RCS file: /cvs/mandoc/mandoc.c,v retrieving revision 1.105 retrieving revision 1.108 diff -u -p -r1.105 -r1.108 --- mandoc/mandoc.c 2018/08/10 22:12:44 1.105 +++ mandoc/mandoc.c 2018/10/25 01:32:40 1.108 @@ -1,4 +1,4 @@ -/* $Id: mandoc.c,v 1.105 2018/08/10 22:12:44 schwarze Exp $ */ +/* $Id: mandoc.c,v 1.108 2018/10/25 01:32:40 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze @@ -139,6 +139,13 @@ mandoc_escape(const char **end, const char **start, in break; } break; + case '*': + if (strncmp(*start, "(.T", 3) != 0) + abort(); + gly = ESCAPE_DEVICE; + *start = ++*end; + *sz = 2; + break; /* * These escapes are of the form \X'Y', where 'X' is the trigger @@ -295,21 +302,29 @@ mandoc_escape(const char **end, const char **start, in switch (gly) { case ESCAPE_FONT: - if (2 == *sz) { - if ('C' == **start) { + if (*sz == 2) { + if (**start == 'C') { + if ((*start)[1] == 'W' || + (*start)[1] == 'R') { + gly = ESCAPE_FONTCW; + break; + } /* - * Treat constant-width font modes + * Treat other constant-width font modes * just like regular font modes. */ (*start)++; (*sz)--; } else { - if ('B' == (*start)[0] && 'I' == (*start)[1]) + if ((*start)[0] == 'B' && (*start)[1] == 'I') gly = ESCAPE_FONTBI; break; } - } else if (1 != *sz) + } else if (*sz != 1) { + if (*sz == 0) + gly = ESCAPE_FONTPREV; break; + } switch (**start) { case '3':