diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-01-30 22:04:44 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-01-30 22:04:44 +0000 |
commit | 6c75cc18099b6c7db33c10df54276a2baeb97ae3 (patch) | |
tree | b4d1367dfc138708b28bf0bae0825f3164794c63 /mdoc_html.c | |
parent | 9fef7fa26fe9bba13379da3ae726ddf95631de22 (diff) | |
download | mandoc-6c75cc18099b6c7db33c10df54276a2baeb97ae3.tar.gz mandoc-6c75cc18099b6c7db33c10df54276a2baeb97ae3.tar.zst mandoc-6c75cc18099b6c7db33c10df54276a2baeb97ae3.zip |
Have pity on the poor stack.
Replace tail recursion by iteration when walking the syntax trees.
No functional change.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r-- | mdoc_html.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mdoc_html.c b/mdoc_html.c index f7ce59e8..337e5dba 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.219 2015/01/23 14:21:01 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.220 2015/01/30 22:04:44 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org> @@ -371,9 +371,10 @@ static void print_mdoc_nodelist(MDOC_ARGS) { - print_mdoc_node(meta, n, h); - if (n->next) - print_mdoc_nodelist(meta, n->next, h); + while (n != NULL) { + print_mdoc_node(meta, n, h); + n = n->next; + } } static void |