* mdocml: Removed restriction on integer manual sections in -man.
@ 2010-05-15 15:54 kristaps
0 siblings, 0 replies; only message in thread
From: kristaps @ 2010-05-15 15:54 UTC (permalink / raw)
To: source
Log Message:
-----------
Removed restriction on integer manual sections in -man.
Modified Files:
--------------
mdocml:
TODO
libman.h
man.c
man.h
man_action.c
man_html.c
man_term.c
man_validate.c
Revision Data
-------------
Index: man_term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_term.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -Lman_term.c -Lman_term.c -u -p -r1.63 -r1.64
--- man_term.c
+++ man_term.c
@@ -911,7 +911,7 @@ print_man_head(struct termp *p, const st
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;
Index: man_html.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_html.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -Lman_html.c -Lman_html.c -u -p -r1.30 -r1.31
--- man_html.c
+++ 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%");
Index: man.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -Lman.h -Lman.h -u -p -r1.29 -r1.30
--- man.h
+++ man.h
@@ -74,7 +74,7 @@ enum man_type {
};
struct man_meta {
- int msec;
+ char *msec;
time_t date;
char *vol;
char *title;
Index: TODO
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/TODO,v
retrieving revision 1.3
retrieving revision 1.4
diff -LTODO -LTODO -u -p -r1.3 -r1.4
--- TODO
+++ 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
Index: man_action.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_action.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -Lman_action.c -Lman_action.c -u -p -r1.30 -r1.31
--- man_action.c
+++ 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);
Index: man.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -Lman.c -Lman.c -u -p -r1.67 -r1.68
--- man.c
+++ 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);
}
Index: libman.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/libman.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -Llibman.h -Llibman.h -u -p -r1.31 -r1.32
--- libman.h
+++ libman.h
@@ -45,7 +45,6 @@ struct man {
enum merr {
WNPRINT = 0,
- WMSEC,
WDATE,
WLNSCOPE,
WLNSCOPE2,
Index: man_validate.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_validate.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -Lman_validate.c -Lman_validate.c -u -p -r1.36 -r1.37
--- man_validate.c
+++ 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);
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-05-15 15:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-15 15:54 mdocml: Removed restriction on integer manual sections in -man kristaps
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).