aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2016-01-08 17:48:09 +0000
committerIngo Schwarze <schwarze@openbsd.org>2016-01-08 17:48:09 +0000
commit924c4755ac64b780903344b188653f513990a771 (patch)
tree8790707d642423006b0f909baf400a6dc333adcb /man_html.c
parentc2d0e548871bfed103ed040312a4333026ee10f1 (diff)
downloadmandoc-924c4755ac64b780903344b188653f513990a771.tar.gz
mandoc-924c4755ac64b780903344b188653f513990a771.tar.zst
mandoc-924c4755ac64b780903344b188653f513990a771.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 'man_html.c')
-rw-r--r--man_html.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/man_html.c b/man_html.c
index 57a289cc..d71eb382 100644
--- a/man_html.c
+++ b/man_html.c
@@ -1,4 +1,4 @@
-/* $Id: man_html.c,v 1.119 2015/10/06 18:32:19 schwarze Exp $ */
+/* $Id: man_html.c,v 1.120 2016/01/08 17:48:09 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -654,7 +654,7 @@ man_UR_pre(MAN_ARGS)
n = n->child;
assert(n->type == ROFFT_HEAD);
- if (n->nchild) {
+ if (n->child != NULL) {
assert(n->child->type == ROFFT_TEXT);
PAIR_CLASS_INIT(&tag[0], "link-ext");
PAIR_HREF_INIT(&tag[1], n->child->string);
@@ -662,7 +662,7 @@ man_UR_pre(MAN_ARGS)
}
assert(n->next->type == ROFFT_BODY);
- if (n->next->nchild)
+ if (n->next->child != NULL)
n = n->next;
print_man_nodelist(man, n->child, mh, h);