summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-05-15 15:54:39 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-05-15 15:54:39 +0000
commitb9297c29623c1e4db9a654cff80d1ac016fdbaee (patch)
tree2f593f482089d568f7cf7614873b114e88046755
parented04d894e573be8a07ec7f68bb5245f83ce49beb (diff)
downloadmandoc-b9297c29623c1e4db9a654cff80d1ac016fdbaee.tar.gz
Removed restriction on integer manual sections in -man.
-rw-r--r--TODO3
-rw-r--r--libman.h1
-rw-r--r--man.c3
-rw-r--r--man.h2
-rw-r--r--man_action.c14
-rw-r--r--man_html.c4
-rw-r--r--man_term.c2
-rw-r--r--man_validate.c2
8 files changed, 12 insertions, 19 deletions
diff --git a/TODO b/TODO
index a7af0955..cb3ae182 100644
--- a/TODO
+++ b/TODO
@@ -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
diff --git a/libman.h b/libman.h
index 1ff650dd..d335ec1b 100644
--- a/libman.h
+++ b/libman.h
@@ -45,7 +45,6 @@ struct man {
enum merr {
WNPRINT = 0,
- WMSEC,
WDATE,
WLNSCOPE,
WLNSCOPE2,
diff --git a/man.c b/man.c
index c8b8b2f2..20c3d1d1 100644
--- a/man.c
+++ b/man.c
@@ -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);
}
diff --git a/man.h b/man.h
index 8744efe9..944003a5 100644
--- a/man.h
+++ b/man.h
@@ -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);
diff --git a/man_html.c b/man_html.c
index ffd721db..22e022e7 100644
--- a/man_html.c
+++ b/man_html.c
@@ -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%");
diff --git a/man_term.c b/man_term.c
index a070648b..f2410527 100644
--- a/man_term.c
+++ b/man_term.c
@@ -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);