summaryrefslogtreecommitdiffstats
path: root/mdoc.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2011-03-07 01:35:51 +0000
committerIngo Schwarze <schwarze@openbsd.org>2011-03-07 01:35:51 +0000
commit860c46e76e21acef233ea6b22f4cf3f19ac662a6 (patch)
tree3fd72d4d6d98f026b3dd3f02bd69673454089ab0 /mdoc.c
parent2d69adf810fd4bbdd2db0a89bd3f90a5d65821f4 (diff)
downloadmandoc-860c46e76e21acef233ea6b22f4cf3f19ac662a6.tar.gz
Clean up date handling,
as a first step to get rid of the frequent petty warnings in this area: - always store dates as strings, not as seconds since the Epoch - for input, try the three most common formats everywhere - for unrecognized format, just pass the date though verbatim - when there is no date at all, still use the current date Originally triggered by a one-line patch from Tim van der Molen, <tbvdm at xs4all dot nl>, which is included here. Feedback and OK on manual parts from jmc@. "please check this in" kristaps@
Diffstat (limited to 'mdoc.c')
-rw-r--r--mdoc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mdoc.c b/mdoc.c
index ef8a3dc2..4be29519 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -1,6 +1,6 @@
/* $Id$ */
/*
- * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
+ * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
@@ -342,8 +342,9 @@ mdoc_macro(MACRO_PROT_ARGS)
m->meta.vol = mandoc_strdup("LOCAL");
if (NULL == m->meta.os)
m->meta.os = mandoc_strdup("LOCAL");
- if (0 == m->meta.date)
- m->meta.date = time(NULL);
+ if (NULL == m->meta.date)
+ m->meta.date = mandoc_normdate(NULL,
+ m->msg, m->data, line, ppos);
m->flags |= MDOC_PBODY;
}