summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/man.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2019-01-05 00:36:47 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2019-01-05 00:36:47 +0000
commit76d625864257b5043d3c9b2a3d7466a50b621e6e (patch)
treee52babd8ac5c9129374a3cc25092cf6e34ac792a /usr.bin/mandoc/man.c
parentd6a0767c68ae491ef8940bf3f04999ba50defea6 (diff)
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.c')
-rw-r--r--usr.bin/mandoc/man.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/mandoc/man.c b/usr.bin/mandoc/man.c
index 2112012e717..934f2b36796 100644
--- a/usr.bin/mandoc/man.c
+++ b/usr.bin/mandoc/man.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: man.c,v 1.134 2018/12/31 10:03:38 schwarze Exp $ */
+/* $OpenBSD: man.c,v 1.135 2019/01/05 00:36:46 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2013,2014,2015,2017,2018 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2013-2015, 2017-2019 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2011 Joerg Sonnenberger <joerg@netbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
@@ -90,9 +90,9 @@ man_descope(struct roff_man *man, int line, int offs, char *start)
}
if ( ! (man->flags & MAN_BLINE))
return;
- man->flags &= ~MAN_BLINE;
man_unscope(man, man->last->parent);
roff_body_alloc(man, line, offs, man->last->tok);
+ man->flags &= ~(MAN_BLINE | ROFF_NONOFILL);
}
static int
@@ -266,9 +266,9 @@ man_pmacro(struct roff_man *man, int ln, char *buf, int offs)
man_macro(tok)->flags & MAN_NSCOPED)
return 1;
- man->flags &= ~MAN_BLINE;
man_unscope(man, man->last->parent);
roff_body_alloc(man, ln, ppos, man->last->tok);
+ man->flags &= ~(MAN_BLINE | ROFF_NONOFILL);
return 1;
}
@@ -311,7 +311,7 @@ man_breakscope(struct roff_man *man, int tok)
n = man->last;
man_unscope(man, n);
roff_body_alloc(man, n->line, n->pos, n->tok);
- man->flags &= ~MAN_BLINE;
+ man->flags &= ~(MAN_BLINE | ROFF_NONOFILL);
}
/*
@@ -338,6 +338,6 @@ man_breakscope(struct roff_man *man, int tok)
"%s breaks %s", roff_name[tok], roff_name[n->tok]);
roff_node_delete(man, n);
- man->flags &= ~MAN_BLINE;
+ man->flags &= ~(MAN_BLINE | ROFF_NONOFILL);
}
}