diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2010-06-27 17:53:27 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2010-06-27 17:53:27 +0000 |
commit | f4c4484c34c9d8eb90438b89791384876bf8efde (patch) | |
tree | 8a46a500d71d41c1f76ee8122945853cbdd1fbb0 /mdoc_term.c | |
parent | 813526936b156ae4cb58886a8969886153ed6139 (diff) | |
download | mandoc-f4c4484c34c9d8eb90438b89791384876bf8efde.tar.gz |
minor .Bk fixes:
* do not print invalid arguments verbatim (no groffs prints them, either)
* do not trigger TERMP_PREKEEP twice
* do not die from invlid arguments (groff won't die, either)
* continue to ignore even valid arguments (just like groff)
ok kristaps@ on the previous version, before removing my last bug ;)
Diffstat (limited to 'mdoc_term.c')
-rw-r--r-- | mdoc_term.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/mdoc_term.c b/mdoc_term.c index 3352bf77..cae18fa3 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -2109,8 +2109,17 @@ static int termp_bk_pre(DECL_ARGS) { - p->flags |= TERMP_PREKEEP; - return(1); + switch (n->type) { + case (MDOC_BLOCK): + return(1); + case (MDOC_HEAD): + return(0); + case (MDOC_BODY): + p->flags |= TERMP_PREKEEP; + return(1); + default: + abort(); + } } @@ -2119,7 +2128,8 @@ static void termp_bk_post(DECL_ARGS) { - p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); + if (MDOC_BODY == n->type) + p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); } /* ARGSUSED */ |