From d1c93a587dfb54f669ffb05890dab4d523cc57dc Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 6 Aug 2014 15:09:05 +0000 Subject: 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. --- mdoc_man.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mdoc_man.c') diff --git a/mdoc_man.c b/mdoc_man.c index f5de18b0..8ef6908a 100644 --- a/mdoc_man.c +++ b/mdoc_man.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_man.c,v 1.67 2014/07/30 00:19:16 schwarze Exp $ */ +/* $Id: mdoc_man.c,v 1.68 2014/08/06 15:09:05 schwarze Exp $ */ /* * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze * @@ -548,8 +548,9 @@ man_mdoc(void *arg, const struct mdoc *mdoc) n = mdoc_node(mdoc); printf(".TH \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"\n", - meta->title, meta->msec, meta->date, - meta->os, meta->vol); + meta->title, + (meta->msec == NULL ? "" : meta->msec), + meta->date, meta->os, meta->vol); /* Disable hyphenation and if nroff, disable justification. */ printf(".nh\n.if n .ad l"); -- cgit v1.2.3