summaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-06-17 11:02:06 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-06-17 11:02:06 +0000
commite4f6b8bbfc80228e5d06e0e611f6f7a939c1af51 (patch)
treeefecadfb6b13b9aaac95fe18e38dd15ee4fe6b3a /mdoc_validate.c
parent112069844468772da75bff132e76dc021a0d51cc (diff)
downloadmandoc-e4f6b8bbfc80228e5d06e0e611f6f7a939c1af51.tar.gz
mandoc-e4f6b8bbfc80228e5d06e0e611f6f7a939c1af51.tar.zst
mandoc-e4f6b8bbfc80228e5d06e0e611f6f7a939c1af51.zip
Cleaned up .Bf validator.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index e628b28f..81211db4 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.12 2009/06/17 10:53:32 kristaps Exp $ */
+/* $Id: mdoc_validate.c,v 1.13 2009/06/17 11:02:06 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -1072,31 +1072,26 @@ post_bf(POST_ARGS)
if (MDOC_BLOCK != mdoc->last->type)
return(1);
- /* FIXME: clean-up .*/
-
head = mdoc->last->head;
if (mdoc->last->args && head->child)
+ return(mdoc_err(mdoc, "one argument expected"));
+ else if (mdoc->last->args)
+ return(1);
- if (NULL == mdoc->last->args) {
- if (NULL == head->child ||
- MDOC_TEXT != head->child->type)
- return(mdoc_err(mdoc, "text argument expected"));
+ if (NULL == head->child || MDOC_TEXT != head->child->type)
+ return(mdoc_err(mdoc, "text argument expected"));
- p = head->child->string;
- if (0 == strcmp(p, "Em"))
- return(1);
- else if (0 == strcmp(p, "Li"))
- return(1);
- else if (0 == strcmp(p, "Sm"))
- return(1);
- return(mdoc_nerr(mdoc, head->child, "invalid font"));
- }
+ p = head->child->string;
- if (head->child)
- return(mdoc_err(mdoc, "one argument expected"));
+ if (0 == strcmp(p, "Em"))
+ return(1);
+ else if (0 == strcmp(p, "Li"))
+ return(1);
+ else if (0 == strcmp(p, "Sm"))
+ return(1);
- return(1);
+ return(mdoc_nerr(mdoc, head->child, "invalid font mode"));
}