From 04cc425ad5987ba914232718ff8bbd5ef418b4d6 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 7 Mar 2011 01:35:51 +0000 Subject: 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, , which is included here. Feedback and OK on manual parts from jmc@. "please check this in" kristaps@ --- mdoc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'mdoc.c') diff --git a/mdoc.c b/mdoc.c index 7e8e8bec..36fd735c 100644 --- a/mdoc.c +++ b/mdoc.c @@ -1,6 +1,6 @@ -/* $Id: mdoc.c,v 1.181 2011/02/09 09:05:52 kristaps Exp $ */ +/* $Id: mdoc.c,v 1.182 2011/03/07 01:35:51 schwarze Exp $ */ /* - * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons + * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010 Ingo Schwarze * * 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; } -- cgit v1.2.3-56-ge451