summaryrefslogtreecommitdiffstats
path: root/man_validate.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2011-12-02 01:37:14 +0000
committerIngo Schwarze <schwarze@openbsd.org>2011-12-02 01:37:14 +0000
commitb44b43f687b8f98c50f0f22a5feae1bc72693b07 (patch)
tree6e63dbeffceec35e93a32a4cf8def8c59ed331d4 /man_validate.c
parentd1b540afdd77328cb66da01be9399236630bf4f6 (diff)
downloadmandoc-b44b43f687b8f98c50f0f22a5feae1bc72693b07.tar.gz
In man(7), when no explicit volume name is given, use the default
volume name for the respective manual section, just like in mdoc(7). This gives us nicer page headers for cvs(1), lynx(1), tic(1), mkhybrid(8), and many curses(3) manuals. ok kristaps@ To not break compatibility, i wrote a corresponding patch for GNU troff which Werner Lemberg accepted upstream at rev. 1.65 of: http://cvs.savannah.gnu.org/viewvc/groff/tmac/an-old.tmac?root=groff
Diffstat (limited to 'man_validate.c')
-rw-r--r--man_validate.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/man_validate.c b/man_validate.c
index 27ecd087..c63dcdfc 100644
--- a/man_validate.c
+++ b/man_validate.c
@@ -413,9 +413,13 @@ post_TH(CHKARGS)
m->meta.source = mandoc_strdup(n->string);
/* TITLE MSEC DATE SOURCE ->VOL<- */
+ /* If missing, use the default VOL name for MSEC. */
if (n && (n = n->next))
m->meta.vol = mandoc_strdup(n->string);
+ else if ('\0' != m->meta.msec[0] &&
+ (NULL != (p = mandoc_a2msec(m->meta.msec))))
+ m->meta.vol = mandoc_strdup(p);
/*
* Remove the `TH' node after we've processed it for our