diff options
-rw-r--r-- | TODO | 3 | ||||
-rw-r--r-- | libman.h | 1 | ||||
-rw-r--r-- | man.c | 3 | ||||
-rw-r--r-- | man.h | 2 | ||||
-rw-r--r-- | man_action.c | 14 | ||||
-rw-r--r-- | man_html.c | 4 | ||||
-rw-r--r-- | man_term.c | 2 | ||||
-rw-r--r-- | man_validate.c | 2 |
8 files changed, 12 insertions, 19 deletions
@@ -21,8 +21,9 @@ reminded by Ludo Smissaert Mon, 10 May 2010 12:15:11 +0200 also reported by jmc@ earlier -- man(7) .TH should recognize "3p" as a section number +- FIXED man(7) .TH should recognize "3p" as a section number found in usr.bin/pkg_add OpenBSD::Getopt + NEEDS MERGING TO openbsd.org - implement \\ in plain text, identical to \e @@ -45,7 +45,6 @@ struct man { enum merr { WNPRINT = 0, - WMSEC, WDATE, WLNSCOPE, WLNSCOPE2, @@ -32,7 +32,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 */ @@ -174,6 +173,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); } @@ -74,7 +74,7 @@ enum man_type { }; struct man_meta { - int msec; + char *msec; time_t date; char *vol; char *title; diff --git a/man_action.c b/man_action.c index 48f4259e..66488d64 100644 --- a/man_action.c +++ b/man_action.c @@ -144,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,8 +152,8 @@ post_TH(struct man *m) if (m->meta.source) free(m->meta.source); - 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 */ @@ -168,12 +166,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 */ @@ -181,7 +174,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); @@ -162,7 +162,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); @@ -267,7 +267,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%"); @@ -911,7 +911,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/man_validate.c b/man_validate.c index a4efebb8..a7b21167 100644 --- a/man_validate.c +++ b/man_validate.c @@ -178,7 +178,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); |