aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2019-01-05 00:36:50 +0000
committerIngo Schwarze <schwarze@openbsd.org>2019-01-05 00:36:50 +0000
commit3aebc3c30c9b70518679c6e3c9610ac4ffc32b61 (patch)
treea40abeffa2939b4f032a27582c271b995112d39b /man_term.c
parent974a808d4eb167475c20c49e55a273647ce3e23a (diff)
downloadmandoc-3aebc3c30c9b70518679c6e3c9610ac4ffc32b61.tar.gz
mandoc-3aebc3c30c9b70518679c6e3c9610ac4ffc32b61.tar.zst
mandoc-3aebc3c30c9b70518679c6e3c9610ac4ffc32b61.zip
Some high-level block macros have an effect similar to temporarily
suspending no-fill mode during their head. Model this with an additional roff parser state flag ROFF_NONOFILL. That is much simpler than it would be to save and restore the ROFF_NOFILL flag itself, in particular since the latter can be switched (with lasting effect) by the .nf and .fi requests even while its effect is temporarily suspended. This commit does not change formatting yet, but prepares for future formatting simplifications and improvements.
Diffstat (limited to 'man_term.c')
-rw-r--r--man_term.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/man_term.c b/man_term.c
index c463d56f..8978398c 100644
--- a/man_term.c
+++ b/man_term.c
@@ -1,7 +1,7 @@
-/* $Id: man_term.c,v 1.225 2018/12/31 11:01:37 schwarze Exp $ */
+/* $Id: man_term.c,v 1.226 2019/01/05 00:36:50 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010-2015, 2017-2019 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -419,7 +419,10 @@ pre_HP(DECL_ARGS)
return 0;
}
- if ((n->flags & NODE_NOFILL) == 0) {
+ if (n->child == NULL)
+ return 0;
+
+ if ((n->child->flags & NODE_NOFILL) == 0) {
p->flags |= TERMP_NOBREAK | TERMP_BRIND;
p->trailspace = 2;
}