diff options
-rw-r--r-- | share/man/man7/man.7 | 17 | ||||
-rw-r--r-- | usr.bin/mandoc/libmandoc.h | 3 | ||||
-rw-r--r-- | usr.bin/mandoc/libmdoc.h | 3 | ||||
-rw-r--r-- | usr.bin/mandoc/man_validate.c | 6 | ||||
-rw-r--r-- | usr.bin/mandoc/mdoc_validate.c | 4 | ||||
-rw-r--r-- | usr.bin/mandoc/msec.c | 7 |
6 files changed, 28 insertions, 12 deletions
diff --git a/share/man/man7/man.7 b/share/man/man7/man.7 index 64dcf965245..4a33a92794b 100644 --- a/share/man/man7/man.7 +++ b/share/man/man7/man.7 @@ -1,4 +1,4 @@ -.\" $OpenBSD: man.7,v 1.25 2011/09/26 23:07:20 schwarze Exp $ +.\" $OpenBSD: man.7,v 1.26 2011/12/02 01:45:43 schwarze Exp $ .\" .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> .\" Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: September 26 2011 $ +.Dd $Mdocdate: December 2 2011 $ .Dt MAN 7 .Os .Sh NAME @@ -834,6 +834,19 @@ The .Sx \&sp macro does not accept negative values in mandoc. In GNU troff, this would result in strange behaviour. +.It +In page header lines, GNU troff versions up to and including 1.21 +only print +.Ar volume +names explicitly specified in the +.Sx \&TH +macro; mandoc and newer groff print the default volume name +corresponding to the +.Ar section +number when no +.Ar volume +is given, like in +.Xr mdoc 7 . .El .Sh SEE ALSO .Xr man 1 , diff --git a/usr.bin/mandoc/libmandoc.h b/usr.bin/mandoc/libmandoc.h index aca7c573b93..7adf160c34b 100644 --- a/usr.bin/mandoc/libmandoc.h +++ b/usr.bin/mandoc/libmandoc.h @@ -1,4 +1,4 @@ -/* $Id: libmandoc.h,v 1.15 2011/09/18 15:54:48 schwarze Exp $ */ +/* $Id: libmandoc.h,v 1.16 2011/12/02 01:45:43 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -49,6 +49,7 @@ char *mandoc_normdate(struct mparse *, char *, int, int); int mandoc_eos(const char *, size_t, int); int mandoc_getcontrol(const char *, int *); int mandoc_strntoi(const char *, size_t, int); +const char *mandoc_a2msec(const char*); void mdoc_free(struct mdoc *); struct mdoc *mdoc_alloc(struct roff *, struct mparse *); diff --git a/usr.bin/mandoc/libmdoc.h b/usr.bin/mandoc/libmdoc.h index 1bdc1ab4ccf..81bebbfbfe0 100644 --- a/usr.bin/mandoc/libmdoc.h +++ b/usr.bin/mandoc/libmdoc.h @@ -1,4 +1,4 @@ -/* $Id: libmdoc.h,v 1.47 2011/09/18 10:25:28 schwarze Exp $ */ +/* $Id: libmdoc.h,v 1.48 2011/12/02 01:45:43 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -124,7 +124,6 @@ const char *mdoc_a2lib(const char *); const char *mdoc_a2st(const char *); const char *mdoc_a2arch(const char *); const char *mdoc_a2vol(const char *); -const char *mdoc_a2msec(const char *); int mdoc_valid_pre(struct mdoc *, struct mdoc_node *); int mdoc_valid_post(struct mdoc *); enum margverr mdoc_argv(struct mdoc *, int, enum mdoct, diff --git a/usr.bin/mandoc/man_validate.c b/usr.bin/mandoc/man_validate.c index dcdb5e8cc8a..136e9cf110c 100644 --- a/usr.bin/mandoc/man_validate.c +++ b/usr.bin/mandoc/man_validate.c @@ -1,4 +1,4 @@ -/* $Id: man_validate.c,v 1.50 2011/11/05 16:02:18 schwarze Exp $ */ +/* $Id: man_validate.c,v 1.51 2011/12/02 01:45:43 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org> @@ -409,9 +409,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 diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c index f3e3479a329..236c15271fc 100644 --- a/usr.bin/mandoc/mdoc_validate.c +++ b/usr.bin/mandoc/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.98 2011/11/19 13:17:44 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.99 2011/12/02 01:45:43 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -2085,7 +2085,7 @@ post_dt(POST_ARGS) * arch = NULL */ - cp = mdoc_a2msec(nn->string); + cp = mandoc_a2msec(nn->string); if (cp) { mdoc->meta.vol = mandoc_strdup(cp); mdoc->meta.msec = mandoc_strdup(nn->string); diff --git a/usr.bin/mandoc/msec.c b/usr.bin/mandoc/msec.c index e5bbcf0b265..5fc778e9b0f 100644 --- a/usr.bin/mandoc/msec.c +++ b/usr.bin/mandoc/msec.c @@ -1,4 +1,4 @@ -/* $Id: msec.c,v 1.6 2011/04/24 16:22:02 schwarze Exp $ */ +/* $Id: msec.c,v 1.7 2011/12/02 01:45:43 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -17,15 +17,14 @@ #include <stdlib.h> #include <string.h> -#include "mdoc.h" #include "mandoc.h" -#include "libmdoc.h" +#include "libmandoc.h" #define LINE(x, y) \ if (0 == strcmp(p, x)) return(y); const char * -mdoc_a2msec(const char *p) +mandoc_a2msec(const char *p) { #include "msec.in" |