aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_term.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
commit04cc425ad5987ba914232718ff8bbd5ef418b4d6 (patch)
treefffb227f8453437d1a80c4109593664bef06d4f4 /man_term.c
parent130d794d1e169870967f8cbb047c5a35891cbfb7 (diff)
downloadmandoc-04cc425ad5987ba914232718ff8bbd5ef418b4d6.tar.gz
mandoc-04cc425ad5987ba914232718ff8bbd5ef418b4d6.tar.zst
mandoc-04cc425ad5987ba914232718ff8bbd5ef418b4d6.zip
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 'man_term.c')
-rw-r--r--man_term.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/man_term.c b/man_term.c
index 82af7018..bb526aac 100644
--- a/man_term.c
+++ b/man_term.c
@@ -1,4 +1,4 @@
-/* $Id: man_term.c,v 1.103 2011/02/09 09:52:47 kristaps Exp $ */
+/* $Id: man_term.c,v 1.104 2011/03/07 01:35:51 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -946,24 +946,18 @@ print_man_nodelist(DECL_ARGS)
static void
print_man_foot(struct termp *p, const void *arg)
{
- char buf[DATESIZ];
const struct man_meta *meta;
meta = (const struct man_meta *)arg;
term_fontrepl(p, TERMFONT_NONE);
- if (meta->rawdate)
- strlcpy(buf, meta->rawdate, DATESIZ);
- else
- time2a(meta->date, buf, DATESIZ);
-
term_vspace(p);
term_vspace(p);
term_vspace(p);
p->flags |= TERMP_NOSPACE | TERMP_NOBREAK;
- p->rmargin = p->maxrmargin - term_strlen(p, buf);
+ p->rmargin = p->maxrmargin - term_strlen(p, meta->date);
p->offset = 0;
/* term_strlen() can return zero. */
@@ -981,7 +975,7 @@ print_man_foot(struct termp *p, const void *arg)
p->rmargin = p->maxrmargin;
p->flags &= ~TERMP_NOBREAK;
- term_word(p, buf);
+ term_word(p, meta->date);
term_flushln(p);
}