=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/roff.c,v retrieving revision 1.69 retrieving revision 1.70 diff -u -r1.69 -r1.70 --- src/usr.bin/mandoc/roff.c 2014/03/07 17:57:28 1.69 +++ src/usr.bin/mandoc/roff.c 2014/03/07 18:37:32 1.70 @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.69 2014/03/07 17:57:28 schwarze Exp $ */ +/* $Id: roff.c,v 1.70 2014/03/07 18:37:32 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -1078,10 +1078,11 @@ /* Always check for the closing delimiter `\}'. */ while (NULL != (ep = strchr(ep, '\\'))) { - if ('}' != *(++ep)) - continue; - *ep = '&'; - roff_ccond(r, ln, pos); + if ('}' == *(++ep)) { + *ep = '&'; + roff_ccond(r, ln, ep - *bufp - 1); + } + ++ep; } return(ROFFRULE_DENY == rr ? ROFF_IGN : ROFF_CONT); } @@ -1096,13 +1097,13 @@ rr = r->last->rule; roffnode_cleanscope(r); - ep = &(*bufp)[pos]; - for ( ; NULL != (ep = strchr(ep, '\\')); ep++) { - ep++; - if ('}' != *ep) - continue; - *ep = '&'; - roff_ccond(r, ln, pos); + ep = *bufp + pos; + while (NULL != (ep = strchr(ep, '\\'))) { + if ('}' == *(++ep)) { + *ep = '&'; + roff_ccond(r, ln, ep - *bufp - 1); + } + ++ep; } return(ROFFRULE_DENY == rr ? ROFF_IGN : ROFF_CONT); }