diff options
author | 2014-08-08 16:17:09 +0000 | |
---|---|---|
committer | 2014-08-08 16:17:09 +0000 | |
commit | 3fdead0c15a9b57a9c5d379eb3eaf79e0a44599f (patch) | |
tree | cdf7ee71b5f7684ce94ade0d0537e56e9efecdf3 /usr.bin/mandoc/mandocdb.c | |
parent | Simplify by allowing only one post-handler. (diff) | |
download | wireguard-openbsd-3fdead0c15a9b57a9c5d379eb3eaf79e0a44599f.tar.xz wireguard-openbsd-3fdead0c15a9b57a9c5d379eb3eaf79e0a44599f.zip |
Bring the handling of defective prologues even closer to groff,
in particular relaxing the distinction between prologue and body
and further improving messages.
* The last .Dd wins and the last .Os wins, even in the body.
* The last .Dt before the first body macro wins.
* Missing title in .Dt defaults to UNTITLED. Warn about it.
* Missing section in .Dt does not default to 1. But warn about it.
* Do not warn multiple times about the same mdoc(7) prologue macro.
* Warn about missing .Os.
* Incomplete .TH defaults to empty strings. Warn about it.
Diffstat (limited to 'usr.bin/mandoc/mandocdb.c')
-rw-r--r-- | usr.bin/mandoc/mandocdb.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/mandoc/mandocdb.c b/usr.bin/mandoc/mandocdb.c index 589713b52ec..30e77a99916 100644 --- a/usr.bin/mandoc/mandocdb.c +++ b/usr.bin/mandoc/mandocdb.c @@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.111 2014/06/21 16:17:56 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.112 2014/08/08 16:17:09 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -1190,8 +1190,9 @@ mpages_merge(struct mchars *mc, struct mparse *mp) goto nextpage; } else if (NULL != mdoc) { mpage->form = FORM_SRC; - mpage->sec = - mandoc_strdup(mdoc_meta(mdoc)->msec); + mpage->sec = mdoc_meta(mdoc)->msec; + mpage->sec = mandoc_strdup( + NULL == mpage->sec ? "" : mpage->sec); mpage->arch = mdoc_meta(mdoc)->arch; mpage->arch = mandoc_strdup( NULL == mpage->arch ? "" : mpage->arch); |