=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/Attic/man_action.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- src/usr.bin/mandoc/Attic/man_action.c 2009/12/22 23:58:00 1.10 +++ src/usr.bin/mandoc/Attic/man_action.c 2009/12/23 22:30:17 1.11 @@ -1,4 +1,4 @@ -/* $Id: man_action.c,v 1.10 2009/12/22 23:58:00 schwarze Exp $ */ +/* $Id: man_action.c,v 1.11 2009/12/23 22:30:17 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -66,9 +66,7 @@ { NULL }, /* PD */ }; -static time_t man_atotime(const char *); - int man_action_post(struct man *m) { @@ -153,13 +151,18 @@ /* TITLE MSEC ->DATE<- SOURCE VOL */ - if (NULL == (n = n->next)) + n = n->next; + 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); + m->meta.date = time(NULL); + } + } else m->meta.date = time(NULL); - else if (0 == (m->meta.date = man_atotime(n->string))) { - if ( ! man_nwarn(m, n, WDATE)) - return(0); - m->meta.date = time(NULL); - } /* TITLE MSEC DATE ->SOURCE<- VOL */ @@ -191,25 +194,4 @@ man_node_freelist(n); return(1); -} - - -static time_t -man_atotime(const char *p) -{ - struct tm tm; - char *pp; - - memset(&tm, 0, sizeof(struct tm)); - - if ((pp = strptime(p, "%b %d %Y", &tm)) && 0 == *pp) - return(mktime(&tm)); - if ((pp = strptime(p, "%d %b %Y", &tm)) && 0 == *pp) - return(mktime(&tm)); - if ((pp = strptime(p, "%b %d, %Y", &tm)) && 0 == *pp) - return(mktime(&tm)); - if ((pp = strptime(p, "%b %Y", &tm)) && 0 == *pp) - return(mktime(&tm)); - - return(0); }