=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/roff.c,v retrieving revision 1.68 retrieving revision 1.69 diff -u -r1.68 -r1.69 --- src/usr.bin/mandoc/roff.c 2014/03/07 02:21:55 1.68 +++ src/usr.bin/mandoc/roff.c 2014/03/07 17:57:28 1.69 @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.68 2014/03/07 02:21:55 schwarze Exp $ */ +/* $Id: roff.c,v 1.69 2014/03/07 17:57:28 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -1066,25 +1066,21 @@ ln, ppos, pos, offs)); } + /* + * If `\}' occurs on a macro line without a preceding macro, + * drop the line completely. + */ + + ep = *bufp + pos; + if ('\\' == ep[0] && '}' == ep[1]) + rr = ROFFRULE_DENY; + /* Always check for the closing delimiter `\}'. */ - ep = &(*bufp)[pos]; while (NULL != (ep = strchr(ep, '\\'))) { if ('}' != *(++ep)) continue; - - /* - * If we're at the end of line, then just chop - * off the \} and resize the buffer. - * If we aren't, then convert it to spaces. - */ - - if ('\0' == *(ep + 1)) { - *--ep = '\0'; - *szp -= 2; - } else - *(ep - 1) = *ep = ' '; - + *ep = '&'; roff_ccond(r, ln, pos); } return(ROFFRULE_DENY == rr ? ROFF_IGN : ROFF_CONT);