diff options
Diffstat (limited to 'man_validate.c')
-rw-r--r-- | man_validate.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/man_validate.c b/man_validate.c index 77ca142e..e9a65510 100644 --- a/man_validate.c +++ b/man_validate.c @@ -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; |