=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/roff.c,v retrieving revision 1.133 retrieving revision 1.134 diff -u -r1.133 -r1.134 --- src/usr.bin/mandoc/roff.c 2015/02/17 17:16:12 1.133 +++ src/usr.bin/mandoc/roff.c 2015/02/17 17:55:12 1.134 @@ -1,4 +1,4 @@ -/* $OpenBSD: roff.c,v 1.133 2015/02/17 17:16:12 schwarze Exp $ */ +/* $OpenBSD: roff.c,v 1.134 2015/02/17 17:55:12 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2012, 2014 Kristaps Dzonsons * Copyright (c) 2010-2015 Ingo Schwarze @@ -2335,10 +2335,19 @@ 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); }