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 /man_term.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 'man_term.c')
-rw-r--r-- | man_term.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1,7 +1,7 @@ -/* $Id: man_term.c,v 1.167 2015/01/30 17:32:16 schwarze Exp $ */ +/* $Id: man_term.c,v 1.168 2015/01/30 22:04:44 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> - * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> + * Copyright (c) 2010-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 @@ -1007,10 +1007,10 @@ static void print_man_nodelist(DECL_ARGS) { - print_man_node(p, mt, n, meta); - if ( ! n->next) - return; - print_man_nodelist(p, mt, n->next, meta); + while (n != NULL) { + print_man_node(p, mt, n, meta); + n = n->next; + } } static void |