summaryrefslogtreecommitdiffstats
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2012-03-23 05:50:24 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2012-03-23 05:50:24 +0000
commita876999e0e8b1a129ab911ecec23c4984badcc31 (patch)
tree3aa3ee33a9f447c29903616d57608b696f5a9d5a /mdoc_validate.c
parent361307c22dc17bf596312dda04b922d185792fe8 (diff)
downloadmandoc-a876999e0e8b1a129ab911ecec23c4984badcc31.tar.gz
Make the `-width' field to `Bl' not puke if it doesn't have an argument.
This makes mandoc work much, much nicer with Mac OSX manpages.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index 422e4c3a..4c48ad0c 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -661,8 +661,13 @@ pre_bl(PRE_ARGS)
comp = 1;
break;
case (MDOC_Width):
- dup = (NULL != n->norm->Bl.width);
- width = n->args->argv[i].value[0];
+ /* NB: this can be empty! */
+ if (n->args->argv[i].sz) {
+ width = n->args->argv[i].value[0];
+ dup = (NULL != n->norm->Bl.width);
+ break;
+ }
+ mdoc_nmsg(mdoc, n, MANDOCERR_IGNARGV);
break;
case (MDOC_Offset):
/* NB: this can be empty! */