=================================================================== RCS file: /cvs/mandoc/roff.c,v retrieving revision 1.252 retrieving revision 1.253 diff -u -p -r1.252 -r1.253 --- mandoc/roff.c 2015/01/21 02:16:52 1.252 +++ mandoc/roff.c 2015/01/22 22:51:43 1.253 @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.252 2015/01/21 02:16:52 schwarze Exp $ */ +/* $Id: roff.c,v 1.253 2015/01/22 22:51:43 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2012, 2014 Kristaps Dzonsons * Copyright (c) 2010-2015 Ingo Schwarze @@ -1004,8 +1004,9 @@ roff_res(struct roff *r, struct buf *buf, int ln, int /* Advance to the end of the name. */ + naml = 0; arg_complete = 1; - for (naml = 0; maxl == 0 || naml < maxl; naml++, cp++) { + while (maxl == 0 || naml < maxl) { if (*cp == '\0') { mandoc_msg(MANDOCERR_ESC_BAD, r->parse, ln, (int)(stesc - buf->buf), stesc); @@ -1014,6 +1015,23 @@ roff_res(struct roff *r, struct buf *buf, int ln, int } if (maxl == 0 && *cp == term) { cp++; + break; + } + if (*cp++ != '\\' || stesc[1] != 'w') { + naml++; + continue; + } + switch (mandoc_escape(&cp, NULL, NULL)) { + case ESCAPE_SPECIAL: + /* FALLTHROUGH */ + case ESCAPE_UNICODE: + /* FALLTHROUGH */ + case ESCAPE_NUMBERED: + /* FALLTHROUGH */ + case ESCAPE_OVERSTRIKE: + naml++; + break; + default: break; } }