aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2010-06-27 17:53:27 +0000
committerIngo Schwarze <schwarze@openbsd.org>2010-06-27 17:53:27 +0000
commitc41f8acfaa961b42d569f0a8ee934543bc8423e5 (patch)
treef5a1228ac9b2fef0043b9f45c2919c754d31a88c /mdoc_term.c
parent30efbc34b0f53a97f7d7991c63948dbe941f249b (diff)
downloadmandoc-c41f8acfaa961b42d569f0a8ee934543bc8423e5.tar.gz
mandoc-c41f8acfaa961b42d569f0a8ee934543bc8423e5.tar.zst
mandoc-c41f8acfaa961b42d569f0a8ee934543bc8423e5.zip
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.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index cad6403e..33cfaac4 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.160 2010/06/27 16:18:13 kristaps Exp $ */
+/* $Id: mdoc_term.c,v 1.161 2010/06/27 17:53:27 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -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 */