diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2009-06-21 18:15:04 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2009-06-21 18:15:04 +0000 |
commit | 9f43b1c3d607d391a0d3bbd9971ae787ae74c0cc (patch) | |
tree | 745369e4ca35b8d5155e9c3dd510c3338805f463 /usr.bin | |
parent | c21c457c732ba50cbe26621d35aec3f4e4d5baec (diff) |
sync to 1.7.19: kristaps@ rewrote post_bf to reduce nesting
no functional change
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mandoc/mdoc_validate.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c index 4cf3c36b977..32771fdffd4 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.9 2009/06/19 07:20:19 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.10 2009/06/21 18:15:03 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -1069,25 +1069,24 @@ post_bf(POST_ARGS) head = mdoc->last->head; - if (NULL == mdoc->last->args) { - if (NULL == head->child || - MDOC_TEXT != head->child->type) - return(mdoc_err(mdoc, "text argument expected")); + if (mdoc->last->args && head->child) + return(mdoc_err(mdoc, "one argument expected")); + else if (mdoc->last->args) + return(1); - 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")); - } + if (NULL == head->child || MDOC_TEXT != head->child->type) + return(mdoc_err(mdoc, "text argument expected")); - if (head->child) - return(mdoc_err(mdoc, "one argument expected")); + p = head->child->string; - return(1); + 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 mode")); } |