aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandocdb.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-08-06 15:09:05 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-08-06 15:09:05 +0000
commitd1c93a587dfb54f669ffb05890dab4d523cc57dc (patch)
treee8862f17d03e32664ba10cc8d9aa4b682bbeff64 /mandocdb.c
parent5f1748e981fcd266c4bc34941a57e258388e7c69 (diff)
downloadmandoc-d1c93a587dfb54f669ffb05890dab4d523cc57dc.tar.gz
mandoc-d1c93a587dfb54f669ffb05890dab4d523cc57dc.tar.zst
mandoc-d1c93a587dfb54f669ffb05890dab4d523cc57dc.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 'mandocdb.c')
-rw-r--r--mandocdb.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mandocdb.c b/mandocdb.c
index 11fe28c6..a604b468 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.154 2014/08/05 14:43:10 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.155 2014/08/06 15:09:05 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -1198,8 +1198,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);