summaryrefslogtreecommitdiffstats
path: root/mdoc_term.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
commit24b160c265af79f44e54160d97249622ff07747a (patch)
tree6bab11dc37008079265c87f0b7d5ee5ad38955f6 /mdoc_term.c
parent4e6374f6dccb1f26d1d9efc07a9ce9c9c600c3e7 (diff)
downloadmandoc-24b160c265af79f44e54160d97249622ff07747a.tar.gz
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 'mdoc_term.c')
-rw-r--r--mdoc_term.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index ea34908c..9cb6e8e0 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -476,7 +476,11 @@ print_mdoc_head(struct termp *p, const void *arg)
meta->vol, meta->arch);
vollen = term_strlen(p, volume);
- mandoc_asprintf(&title, "%s(%s)", meta->title, meta->msec);
+ if (NULL == meta->msec)
+ title = mandoc_strdup(meta->title);
+ else
+ mandoc_asprintf(&title, "%s(%s)",
+ meta->title, meta->msec);
titlen = term_strlen(p, title);
p->flags |= TERMP_NOBREAK | TERMP_NOSPACE;