aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-12-26 19:02:04 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-12-26 19:02:04 +0000
commit53beca6323818e3247d4b1602f92addf87fb3f69 (patch)
treeabc34e2344c9efc168e3f63aa86596e0f989892f
parentf6563ba0304acecf4e8cb3d3ca84faf6ebeac5d1 (diff)
downloadmandoc-53beca6323818e3247d4b1602f92addf87fb3f69.tar.gz
mandoc-53beca6323818e3247d4b1602f92addf87fb3f69.tar.zst
mandoc-53beca6323818e3247d4b1602f92addf87fb3f69.zip
Stop parsing man(7) input when we found all we were searching for,
such that we don't trigger an assertion on a duplicate NAME section.
-rw-r--r--mandocdb.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mandocdb.c b/mandocdb.c
index 36ce96cc..337a815a 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.76 2013/10/27 17:01:18 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.77 2013/12/26 19:02:04 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
@@ -1366,8 +1366,11 @@ parse_man(struct of *of, const struct man_node *n)
}
}
- for (n = n->child; n; n = n->next)
+ for (n = n->child; n; n = n->next) {
+ if (NULL != of->desc)
+ break;
parse_man(of, n);
+ }
}
static void