summaryrefslogtreecommitdiffstatshomepage
path: root/man_validate.c
diff options
context:
space:
mode:
Diffstat (limited to 'man_validate.c')
-rw-r--r--man_validate.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/man_validate.c b/man_validate.c
index 7c06e47d..7a573b76 100644
--- a/man_validate.c
+++ b/man_validate.c
@@ -1,4 +1,4 @@
-/* $Id: man_validate.c,v 1.13 2009/06/22 10:40:04 kristaps Exp $ */
+/* $Id: man_validate.c,v 1.14 2009/06/22 13:09:17 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -38,6 +38,7 @@ static int check_le1(POSTARGS);
static int check_le2(POSTARGS);
static int check_le5(POSTARGS);
static int check_text(POSTARGS);
+static int check_root(POSTARGS);
static v_post posts_le1[] = { check_le1, NULL };
static v_post posts_le2[] = { check_le2, NULL };
@@ -85,8 +86,7 @@ man_valid_post(struct man *m)
case (MAN_TEXT):
return(check_text(m, m->last));
case (MAN_ROOT):
- /* FIXME: validate that TH has been invoked! */
- return(1);
+ return(check_root(m, m->last));
default:
break;
}
@@ -102,6 +102,19 @@ man_valid_post(struct man *m)
static int
+check_root(POSTARGS)
+{
+
+ if (NULL == m->first->child)
+ return(man_nerr(m, n, WNODATA));
+ if (NULL == m->meta.title)
+ return(man_nerr(m, n, WNOTITLE));
+
+ return(1);
+}
+
+
+static int
check_text(POSTARGS)
{
const char *p;