summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/man_macro.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2016-01-08 17:48:04 +0000
committerschwarze <schwarze@openbsd.org>2016-01-08 17:48:04 +0000
commit30e5ee0603ba55c62e39e52e29f67681cf1fdce2 (patch)
treedc5034d61098367dc7e0b3d473a1980d9995f001 /usr.bin/mandoc/man_macro.c
parentsync (diff)
downloadwireguard-openbsd-30e5ee0603ba55c62e39e52e29f67681cf1fdce2.tar.xz
wireguard-openbsd-30e5ee0603ba55c62e39e52e29f67681cf1fdce2.zip
Delete the redundant "nchild" member of struct roff_node, replacing
most uses by one, a few by two pointer checks, and only one by a tiny loop - not only making data smaller, but code shorter as well. This gets rid of an implicit invariant that confused both static analysis tools and human auditors. No functional change.
Diffstat (limited to 'usr.bin/mandoc/man_macro.c')
-rw-r--r--usr.bin/mandoc/man_macro.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/mandoc/man_macro.c b/usr.bin/mandoc/man_macro.c
index b91a0c30645..b49d9915063 100644
--- a/usr.bin/mandoc/man_macro.c
+++ b/usr.bin/mandoc/man_macro.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man_macro.c,v 1.75 2015/10/22 21:53:49 schwarze Exp $ */
+/* $OpenBSD: man_macro.c,v 1.76 2016/01/08 17:48:04 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2012, 2013, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -155,7 +155,7 @@ rew_scope(struct roff_man *man, int tok)
/* Preserve empty paragraphs before RS. */
n = man->last;
- if (tok == MAN_RS && n->nchild == 0 &&
+ if (tok == MAN_RS && n->child == NULL &&
(n->tok == MAN_P || n->tok == MAN_PP || n->tok == MAN_LP))
return;