summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--roff.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/roff.c b/roff.c
index ad8c6eeb..1370a58b 100644
--- a/roff.c
+++ b/roff.c
@@ -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);
}