summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/mdoc_validate.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/mandoc/mdoc_validate.c')
-rw-r--r--usr.bin/mandoc/mdoc_validate.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c
index 9d8827d4b97..f3e3479a329 100644
--- a/usr.bin/mandoc/mdoc_validate.c
+++ b/usr.bin/mandoc/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.97 2011/11/16 19:47:58 schwarze Exp $ */
+/* $Id: mdoc_validate.c,v 1.98 2011/11/19 13:17:44 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -1690,6 +1690,14 @@ post_rs(POST_ARGS)
}
/*
+ * Nothing to sort if only invalid nodes were found
+ * inside the `Rs' body.
+ */
+
+ if (NULL == mdoc->last->child)
+ return(1);
+
+ /*
* The full `Rs' block needs special handling to order the
* sub-elements according to `rsord'. Pick through each element
* and correctly order it. This is a insertion sort.