aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit92b82a1384a9e9840e25d2364a36c9fa50384e34 (patch)
tree827d1f0788bc8e1d2f9fb69aa580c83339372c74 /man_validate.c
parentb505ecce3956d6be1ab0554257d7ce9ead09ff89 (diff)
downloadmandoc-92b82a1384a9e9840e25d2364a36c9fa50384e34.tar.gz
mandoc-92b82a1384a9e9840e25d2364a36c9fa50384e34.tar.zst
mandoc-92b82a1384a9e9840e25d2364a36c9fa50384e34.zip
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.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/man_validate.c b/man_validate.c
index d39618ff..bf266ca6 100644
--- a/man_validate.c
+++ b/man_validate.c
@@ -1,4 +1,4 @@
-/* $Id: man_validate.c,v 1.78 2011/11/07 01:24:40 schwarze Exp $ */
+/* $Id: man_validate.c,v 1.79 2011/12/02 01:37:14 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -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