summaryrefslogtreecommitdiffstatshomepage
path: root/term.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-02-22 14:31:08 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-02-22 14:31:08 +0000
commit8c0bc76f597bfa8102ebaae346815b1375f941f4 (patch)
treee4cb87fda759be3b2313c270f7d77e0070195649 /term.c
parent621648b3b0a34af595f1b79705e6b0a2a9e391a7 (diff)
downloadmandoc-8c0bc76f597bfa8102ebaae346815b1375f941f4.tar.gz
mandoc-8c0bc76f597bfa8102ebaae346815b1375f941f4.tar.zst
mandoc-8c0bc76f597bfa8102ebaae346815b1375f941f4.zip
Cleaned up validation source a bit.
Fixed `Nm' and `Nd' detection. Added a few more terminal outputs.
Diffstat (limited to 'term.c')
-rw-r--r--term.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/term.c b/term.c
index 40bb4dbc..1b67bfc9 100644
--- a/term.c
+++ b/term.c
@@ -1,4 +1,4 @@
-/* $Id: term.c,v 1.6 2009/02/21 21:00:06 kristaps Exp $ */
+/* $Id: term.c,v 1.7 2009/02/22 14:31:08 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -24,6 +24,10 @@
#include <string.h>
#include <unistd.h>
+#ifdef __linux__
+#include <time.h>
+#endif
+
#include "term.h"
enum termstyle {
@@ -46,6 +50,10 @@ static void pescape(struct termp *,
static void chara(struct termp *, char);
static void style(struct termp *, enum termstyle);
+#ifdef __linux__
+extern size_t strlcat(char *, const char *, size_t);
+extern size_t strlcpy(char *, const char *, size_t);
+#endif
void
flushln(struct termp *p)
@@ -363,7 +371,12 @@ termprint_footer(struct termp *p, const struct mdoc_meta *meta)
err(1, "malloc");
tm = localtime(&meta->date);
+
+#ifdef __linux__
+ if (0 == strftime(buf, p->rmargin, "%B %d, %Y", tm))
+#else
if (NULL == strftime(buf, p->rmargin, "%B %d, %Y", tm))
+#endif
err(1, "strftime");
osz = strlcpy(os, meta->os, p->rmargin);