summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/man_term.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2019-01-05 00:36:46 +0000
committerschwarze <schwarze@openbsd.org>2019-01-05 00:36:46 +0000
commit94a3c318e2a9b782bdf5fed9419561a4032e7d02 (patch)
tree6633624a2478f9a8a0f7719a15a2db382ef3db46 /usr.bin/mandoc/man_term.c
parentenable ohci at fdt (diff)
downloadwireguard-openbsd-94a3c318e2a9b782bdf5fed9419561a4032e7d02.tar.xz
wireguard-openbsd-94a3c318e2a9b782bdf5fed9419561a4032e7d02.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 'usr.bin/mandoc/man_term.c')
-rw-r--r--usr.bin/mandoc/man_term.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c
index 80407561d5d..607842d997c 100644
--- a/usr.bin/mandoc/man_term.c
+++ b/usr.bin/mandoc/man_term.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: man_term.c,v 1.178 2018/12/31 11:01:34 schwarze Exp $ */
+/* $OpenBSD: man_term.c,v 1.179 2019/01/05 00:36:46 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
@@ -417,7 +417,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;
}