version 1.35, 2010/05/17 10:50:32 |
version 1.39, 2010/05/26 14:03:54 |
|
|
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
|
|
|
#include "mandoc.h" |
#include "libman.h" |
#include "libman.h" |
#include "libmandoc.h" |
#include "libmandoc.h" |
|
|
Line 103 post_fi(struct man *m) |
|
Line 104 post_fi(struct man *m) |
|
{ |
{ |
|
|
if ( ! (MAN_LITERAL & m->flags)) |
if ( ! (MAN_LITERAL & m->flags)) |
if ( ! man_nwarn(m, m->last, WNLITERAL)) |
if ( ! man_nmsg(m, m->last, MANDOCERR_NOSCOPE)) |
return(0); |
return(0); |
m->flags &= ~MAN_LITERAL; |
m->flags &= ~MAN_LITERAL; |
return(1); |
return(1); |
Line 115 post_nf(struct man *m) |
|
Line 116 post_nf(struct man *m) |
|
{ |
{ |
|
|
if (MAN_LITERAL & m->flags) |
if (MAN_LITERAL & m->flags) |
if ( ! man_nwarn(m, m->last, WOLITERAL)) |
if ( ! man_nmsg(m, m->last, MANDOCERR_SCOPEREP)) |
return(0); |
return(0); |
m->flags |= MAN_LITERAL; |
m->flags |= MAN_LITERAL; |
return(1); |
return(1); |
Line 135 post_TH(struct man *m) |
|
Line 136 post_TH(struct man *m) |
|
free(m->meta.source); |
free(m->meta.source); |
if (m->meta.msec) |
if (m->meta.msec) |
free(m->meta.msec); |
free(m->meta.msec); |
|
if (m->meta.rawdate) |
|
free(m->meta.rawdate); |
|
|
m->meta.title = m->meta.vol = |
m->meta.title = m->meta.vol = m->meta.rawdate = |
m->meta.msec = m->meta.source = NULL; |
m->meta.msec = m->meta.source = NULL; |
m->meta.date = 0; |
m->meta.date = 0; |
|
|
Line 154 post_TH(struct man *m) |
|
Line 157 post_TH(struct man *m) |
|
|
|
/* TITLE MSEC ->DATE<- SOURCE VOL */ |
/* TITLE MSEC ->DATE<- SOURCE VOL */ |
|
|
|
/* |
|
* Try to parse the date. If this works, stash the epoch (this |
|
* is optimal because we can reformat it in the canonical form). |
|
* If it doesn't parse, isn't specified at all, or is an empty |
|
* string, then use the current date. |
|
*/ |
|
|
n = n->next; |
n = n->next; |
if (n) { |
if (n && n->string && *n->string) { |
m->meta.date = mandoc_a2time |
m->meta.date = mandoc_a2time |
(MTIME_ISO_8601, n->string); |
(MTIME_ISO_8601, n->string); |
if (0 == m->meta.date) { |
if (0 == m->meta.date) { |
if ( ! man_nwarn(m, n, WDATE)) |
if ( ! man_nmsg(m, n, MANDOCERR_BADDATE)) |
return(0); |
return(0); |
m->meta.date = time(NULL); |
m->meta.rawdate = mandoc_strdup(n->string); |
} |
} |
} else |
} else |
m->meta.date = time(NULL); |
m->meta.date = time(NULL); |
Line 218 post_AT(struct man *m) |
|
Line 228 post_AT(struct man *m) |
|
p = unix_versions[0]; |
p = unix_versions[0]; |
} |
} |
|
|
|
if (m->meta.source) |
|
free(m->meta.source); |
|
|
m->meta.source = mandoc_strdup(p); |
m->meta.source = mandoc_strdup(p); |
|
|
return(1); |
return(1); |
Line 257 post_UC(struct man *m) |
|
Line 270 post_UC(struct man *m) |
|
else |
else |
p = bsd_versions[0]; |
p = bsd_versions[0]; |
} |
} |
|
|
|
if (m->meta.source) |
|
free(m->meta.source); |
|
|
m->meta.source = mandoc_strdup(p); |
m->meta.source = mandoc_strdup(p); |
|
|