summaryrefslogtreecommitdiffstats
path: root/man_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-01-30 22:04:44 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-01-30 22:04:44 +0000
commit36097423ac8b35b42f700e0b63e3b6ac44d88235 (patch)
tree78f67f15282d27b3e96c4558595ba0edb760cd0c /man_html.c
parentbfdc50c69f00d233ff869c3f3590ad37e1aa0be7 (diff)
downloadmandoc-36097423ac8b35b42f700e0b63e3b6ac44d88235.tar.gz
Have pity on the poor stack.
Replace tail recursion by iteration when walking the syntax trees. No functional change.
Diffstat (limited to 'man_html.c')
-rw-r--r--man_html.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/man_html.c b/man_html.c
index 4898b652..9363f5ae 100644
--- a/man_html.c
+++ b/man_html.c
@@ -1,7 +1,7 @@
/* $Id$ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2013, 2014, 2015 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
@@ -192,9 +192,10 @@ static void
print_man_nodelist(MAN_ARGS)
{
- print_man_node(man, n, mh, h);
- if (n->next)
- print_man_nodelist(man, n->next, mh, h);
+ while (n != NULL) {
+ print_man_node(man, n, mh, h);
+ n = n->next;
+ }
}
static void