diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-08-08 16:17:10 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-08-08 16:17:10 +0000 |
commit | 3c96aa96df01e9e6964514030cbbd39b99bf341e (patch) | |
tree | 4abfb8635e7f1ba45f613a7d186d1c15dbc32188 /usr.bin/mandoc/read.c | |
parent | 467e004df6f518b5ced60c665889ac3a8ba3cdbb (diff) |
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/read.c')
-rw-r--r-- | usr.bin/mandoc/read.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/mandoc/read.c b/usr.bin/mandoc/read.c index bfe2b526958..1f8d7cca225 100644 --- a/usr.bin/mandoc/read.c +++ b/usr.bin/mandoc/read.c @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.56 2014/08/08 15:54:10 schwarze Exp $ */ +/* $Id: read.c,v 1.57 2014/08/08 16:17:09 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -85,16 +85,19 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "generic warning", /* related to the prologue */ - "missing .TH macro, using \"unknown 1\"", + "missing manual title, using UNTITLED", + "missing manual title, using \"\"", "lower case character in document title", + "missing manual section, using \"\"", "unknown manual section", "unknown manual volume or arch", "missing date, using today's date", "cannot parse date, using it verbatim", - "prologue macros out of order", + "missing Os macro, using \"\"", "duplicate prologue macro", - "incomplete prologue, terminated by", - "skipping prologue macro in body", + "late prologue macro", + "skipping late title macro", + "prologue macros out of order", /* related to document structure */ ".so is fragile, better use ln(1)", |