diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2010-05-15 18:06:04 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2010-05-15 18:06:04 +0000 |
commit | 48de794fa862d8723903be0660f26607e3b55d13 (patch) | |
tree | 99690e542d960900e62053bd5ce4ba5e7ffb35c2 /usr.bin/mandoc | |
parent | c2c62a88f6f9d56daa2265e1476dbf15d196f99c (diff) |
removed restriction on integer manual sections in -man;
by kristaps@
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r-- | usr.bin/mandoc/libman.h | 3 | ||||
-rw-r--r-- | usr.bin/mandoc/man.c | 5 | ||||
-rw-r--r-- | usr.bin/mandoc/man.h | 4 | ||||
-rw-r--r-- | usr.bin/mandoc/man_action.c | 21 | ||||
-rw-r--r-- | usr.bin/mandoc/man_html.c | 6 | ||||
-rw-r--r-- | usr.bin/mandoc/man_term.c | 4 | ||||
-rw-r--r-- | usr.bin/mandoc/man_validate.c | 4 |
7 files changed, 20 insertions, 27 deletions
diff --git a/usr.bin/mandoc/libman.h b/usr.bin/mandoc/libman.h index 7e50e366c15..5c72f729103 100644 --- a/usr.bin/mandoc/libman.h +++ b/usr.bin/mandoc/libman.h @@ -1,4 +1,4 @@ -/* $Id: libman.h,v 1.17 2010/05/08 01:52:07 schwarze Exp $ */ +/* $Id: libman.h,v 1.18 2010/05/15 18:06:02 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -46,7 +46,6 @@ struct man { enum merr { WNPRINT = 0, - WMSEC, WDATE, WLNSCOPE, WLNSCOPE2, diff --git a/usr.bin/mandoc/man.c b/usr.bin/mandoc/man.c index 8ebac56ed9d..1aad5bb28d8 100644 --- a/usr.bin/mandoc/man.c +++ b/usr.bin/mandoc/man.c @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.28 2010/05/14 19:52:43 schwarze Exp $ */ +/* $Id: man.c,v 1.29 2010/05/15 18:06:02 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -28,7 +28,6 @@ const char *const __man_merrnames[WERRMAX] = { "invalid character", /* WNPRINT */ - "invalid manual section", /* WMSEC */ "invalid date format", /* WDATE */ "scope of prior line violated", /* WLNSCOPE */ "over-zealous prior line scope violation", /* WLNSCOPE2 */ @@ -187,6 +186,8 @@ man_free1(struct man *man) free(man->meta.source); if (man->meta.vol) free(man->meta.vol); + if (man->meta.msec) + free(man->meta.msec); } diff --git a/usr.bin/mandoc/man.h b/usr.bin/mandoc/man.h index fd4451bfce9..61cd564bad9 100644 --- a/usr.bin/mandoc/man.h +++ b/usr.bin/mandoc/man.h @@ -1,4 +1,4 @@ -/* $Id: man.h,v 1.17 2010/05/14 19:52:43 schwarze Exp $ */ +/* $Id: man.h,v 1.18 2010/05/15 18:06:02 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -77,7 +77,7 @@ enum man_type { }; struct man_meta { - int msec; + char *msec; time_t date; char *vol; char *title; diff --git a/usr.bin/mandoc/man_action.c b/usr.bin/mandoc/man_action.c index 234c22f05f7..f50c86b242b 100644 --- a/usr.bin/mandoc/man_action.c +++ b/usr.bin/mandoc/man_action.c @@ -1,6 +1,6 @@ -/* $Id: man_action.c,v 1.15 2010/04/25 16:32:19 schwarze Exp $ */ +/* $Id: man_action.c,v 1.16 2010/05/15 18:06:02 schwarze Exp $ */ /* - * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> + * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -124,7 +124,6 @@ post_de(struct man *m) */ if (MAN_BLOCK == m->last->type) man_node_delete(m, m->last); - return(1); } @@ -145,8 +144,6 @@ static int post_TH(struct man *m) { struct man_node *n; - char *ep; - long lval; if (m->meta.title) free(m->meta.title); @@ -154,9 +151,11 @@ post_TH(struct man *m) free(m->meta.vol); if (m->meta.source) free(m->meta.source); + if (m->meta.msec) + free(m->meta.msec); - m->meta.title = m->meta.vol = m->meta.source = NULL; - m->meta.msec = 0; + m->meta.title = m->meta.vol = + m->meta.msec = m->meta.source = NULL; m->meta.date = 0; /* ->TITLE<- MSEC DATE SOURCE VOL */ @@ -169,12 +168,7 @@ post_TH(struct man *m) n = n->next; assert(n); - - lval = strtol(n->string, &ep, 10); - if (n->string[0] != '\0' && *ep == '\0') - m->meta.msec = (int)lval; - else if ( ! man_nwarn(m, n, WMSEC)) - return(0); + m->meta.msec = mandoc_strdup(n->string); /* TITLE MSEC ->DATE<- SOURCE VOL */ @@ -182,7 +176,6 @@ post_TH(struct man *m) if (n) { m->meta.date = mandoc_a2time (MTIME_ISO_8601, n->string); - if (0 == m->meta.date) { if ( ! man_nwarn(m, n, WDATE)) return(0); diff --git a/usr.bin/mandoc/man_html.c b/usr.bin/mandoc/man_html.c index b17d6be2833..7640351dcce 100644 --- a/usr.bin/mandoc/man_html.c +++ b/usr.bin/mandoc/man_html.c @@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.9 2010/04/25 16:32:19 schwarze Exp $ */ +/* $Id: man_html.c,v 1.10 2010/05/15 18:06:02 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -161,7 +161,7 @@ print_man_head(MAN_ARGS) print_gen_head(h); bufinit(h); - buffmt(h, "%s(%d)", m->title, m->msec); + buffmt(h, "%s(%s)", m->title, m->msec); print_otag(h, TAG_TITLE, 0, NULL); print_text(h, h->buf); @@ -266,7 +266,7 @@ man_root_pre(MAN_ARGS) if (m->vol) (void)strlcat(b, m->vol, BUFSIZ); - snprintf(title, BUFSIZ - 1, "%s(%d)", m->title, m->msec); + snprintf(title, BUFSIZ - 1, "%s(%s)", m->title, m->msec); PAIR_CLASS_INIT(&tag[0], "header"); bufcat_style(h, "width", "100%"); diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c index 478daa5372b..9036b670dba 100644 --- a/usr.bin/mandoc/man_term.c +++ b/usr.bin/mandoc/man_term.c @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.30 2010/05/14 19:52:43 schwarze Exp $ */ +/* $Id: man_term.c,v 1.31 2010/05/15 18:06:03 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -910,7 +910,7 @@ print_man_head(struct termp *p, const struct man_meta *m) strlcpy(buf, m->vol, BUFSIZ); buflen = strlen(buf); - snprintf(title, BUFSIZ, "%s(%d)", m->title, m->msec); + snprintf(title, BUFSIZ, "%s(%s)", m->title, m->msec); titlen = strlen(title); p->offset = 0; diff --git a/usr.bin/mandoc/man_validate.c b/usr.bin/mandoc/man_validate.c index df27998d5a0..0c34e0cd43b 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.20 2010/05/13 20:34:29 schwarze Exp $ */ +/* $Id: man_validate.c,v 1.21 2010/05/15 18:06:03 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -177,7 +177,7 @@ check_root(CHKARGS) */ m->meta.title = mandoc_strdup("unknown"); m->meta.date = time(NULL); - m->meta.msec = 1; + m->meta.msec = mandoc_strdup("1"); } return(1); |