=================================================================== RCS file: /cvs/mandoc/roff.c,v retrieving revision 1.261 retrieving revision 1.262 diff -u -p -r1.261 -r1.262 --- mandoc/roff.c 2015/02/17 17:16:52 1.261 +++ mandoc/roff.c 2015/02/17 18:09:14 1.262 @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.261 2015/02/17 17:16:52 schwarze Exp $ */ +/* $Id: roff.c,v 1.262 2015/02/17 18:09:14 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2012, 2014 Kristaps Dzonsons * Copyright (c) 2010-2015 Ingo Schwarze @@ -2337,10 +2337,19 @@ roff_it(ROFF_ARGS) return(ROFF_IGN); } - /* Arm the input line trap. */ + while (isspace((unsigned char)buf->buf[pos])) + pos++; + /* + * Arm the input line trap. + * Special-casing "an-trap" is an ugly workaround to cope + * with DocBook stupidly fiddling with man(7) internals. + */ + roffit_lines = iv; - roffit_macro = mandoc_strdup(buf->buf + pos); + roffit_macro = mandoc_strdup(iv != 1 || + strcmp(buf->buf + pos, "an-trap") ? + buf->buf + pos : "br"); return(ROFF_IGN); }